Skip to content
2 changes: 1 addition & 1 deletion hooks/hackathon/use-organizer-submissions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export function useOrganizerSubmissions(
const currentPage = rawPag?.page || page;
const limit = rawPag?.limit || pagination.limit || initialLimit;
const total = rawPag?.total || 0;
const totalPages = rawPag?.totalPages || Math.ceil(total / limit) || 1;
const totalPages = Math.ceil(total / limit) || 1;

setSubmissions(list);
setPagination({
Expand Down
3 changes: 1 addition & 2 deletions hooks/use-hackathons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -582,8 +582,7 @@ export function useHackathons(
const responsePage = pagination?.page || 1;
const totalItems = pagination?.total || 0;
const itemsPerPage = pagination?.limit || pageSize;
const totalPages =
pagination?.totalPages || Math.ceil(totalItems / itemsPerPage) || 1;
const totalPages = Math.ceil(totalItems / itemsPerPage) || 1;

setParticipants(response.data?.participants || []);
setParticipantsPagination({
Expand Down