Skip to content
Snippets Groups Projects
Commit 43c1476a authored by Lucas Eduardo Schoenfelder's avatar Lucas Eduardo Schoenfelder
Browse files

added total result count

parent dd3885a5
No related branches found
No related tags found
3 merge requests!57Merge of develop into master,!56Fixed buttons reportar, seguir, compartilhar, guardar and entrar (in comments...,!39Update admin system
......@@ -74,7 +74,7 @@ export default function Search(props) {
const [optionResult, setOptionResult] = useState(option);
currOption = option;
function handleSuccessfulGet(data) {
function handleSuccessfulGet(data, headers) {
if (currOption === "LearningObject") setResultsResource(data);
else if (currOption === "Collection") setResultsCollection(data);
else if (currOption === "User") setResultsUser(data);
......@@ -87,7 +87,7 @@ export default function Search(props) {
},
});
console.log(data);
setTotalResults(data.length);
setTotalResults(headers.get('X-Total-Count'));
setOptionResult(currOption);
setIsLoading(false);
setIsFiltering(false);
......@@ -188,8 +188,8 @@ export default function Search(props) {
<Grid item xs={12}>
<div style={{ display: "flex", flexDirection: "column", justifyContent: "center" }}>
<div style={{ textAlign: "center", paddingTop: 10, fontWeight: "bolder" }}>
{/* Exibindo {totalResults === 0 ? 0 : resultsPerPage} resultados de {totalResults} encontrados */}
Exibindo {totalResults === 0 ? 0 : resultsPerPage} resultados
Exibindo {totalResults === 0 ? 0 : resultsPerPage} resultados de {totalResults} encontrados
{/*Exibindo {totalResults === 0 ? 0 : resultsPerPage} resultados*/}
</div>
</div>
</Grid>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment