mirror of
https://git.v0id.ovh/n3wt-innov/n3wt-school.git
synced 2026-01-28 23:43:22 +00:00
fix: Correction sur le calcul du nombre total de pages [#1]
This commit is contained in:
@ -88,7 +88,7 @@ export default function Page({ params: { locale } }) {
|
||||
if (ficheInscriptions) {
|
||||
setFichesInscriptionsDataEnCours(fichesInscriptions);
|
||||
}
|
||||
const calculatedTotalPages = Math.ceil(count / pageSize);
|
||||
const calculatedTotalPages = count === 0 ? 1 : Math.ceil(count / pageSize);
|
||||
setTotalPending(count);
|
||||
setTotalPages(calculatedTotalPages);
|
||||
}
|
||||
@ -304,10 +304,10 @@ export default function Page({ params: { locale } }) {
|
||||
.then(data => {
|
||||
console.log('Success:', data);
|
||||
setFichesInscriptionsDataEnCours(prevState => {
|
||||
if (prevState && prevState.length > 0) {
|
||||
if (prevState) {
|
||||
return [...prevState, data];
|
||||
}
|
||||
return prevState;
|
||||
return [data];
|
||||
});
|
||||
setTotalPending(totalPending+1);
|
||||
if (updatedData.autoMail) {
|
||||
|
||||
Reference in New Issue
Block a user