Skip to content

fixed the paginition in student records #32

Open
Sampurnasit wants to merge 1 commit intoGDSC-RCCIIT:mainfrom
Sampurnasit:sampurnasit/student-record-paginition-fix
Open

fixed the paginition in student records #32
Sampurnasit wants to merge 1 commit intoGDSC-RCCIIT:mainfrom
Sampurnasit:sampurnasit/student-record-paginition-fix

Conversation

@Sampurnasit
Copy link
Copy Markdown
Contributor

Problem

Pagination behaved incorrectly when the student count was exactly 11.
totalPages had a hardcoded edge-case that subtracted 1 whenever
filtered.length === 11, causing one page to be lost.

Fix

Removed the hardcoded special case. totalPages is now always computed
correctly via Math.ceil(filtered.length / pageSize).

Result

With 11 students and pageSize 5, pagination now correctly shows 3 pages.

Fixes #23

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Exactly 11 students breaks pagination (inside school building)

1 participant