From 8796389667b8447b493f2c3eb585a1ca6f015eb3 Mon Sep 17 00:00:00 2001 From: Kevin Pierce Date: Sun, 26 Nov 2023 16:00:24 -0500 Subject: [PATCH] [BUG] Pagination Total Num of Pages Fix (#209) --- frontend/src/components/common/Pagination.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/components/common/Pagination.tsx b/frontend/src/components/common/Pagination.tsx index c519a1eb..5f6fa1d9 100644 --- a/frontend/src/components/common/Pagination.tsx +++ b/frontend/src/components/common/Pagination.tsx @@ -40,7 +40,7 @@ const Pagination = ({ setResultsPerPage, getRecords, }: Props): React.ReactElement => { - const numPages = Math.ceil(numRecords / resultsPerPage); + const numPages = Math.ceil(Math.max(1, numRecords) / resultsPerPage); const handleNumberInputChange = ( newUserPageNumString: string,