Skip to content

254#289

Merged
omkarhole merged 3 commits into
omkarhole:mainfrom
Aditya8369:254
Jun 4, 2026
Merged

254#289
omkarhole merged 3 commits into
omkarhole:mainfrom
Aditya8369:254

Conversation

@Aditya8369

Copy link
Copy Markdown
Contributor

Pagination is now consistent across backend + frontend for ReferralList.

Backend (backend/controllers/referral.controller.js):

getReferrals now computes numeric pageNum / limitNum from req.query using Number(page) / Number(limit).
skip is computed using skip = (pageNum - 1) * limitNum.
Removed skip * 1 / limit * 1 and uses .skip(skip) / .limit(limitNum).
Response pagination.page and pagination.limit now always match the requested page/limit (as numbers).
Frontend (frontend/src/components/ReferralList.jsx):

Added loadingNextPage state.
Pagination button states now disable on next-page fetch.
UI shows a small “(Loading…)” indicator next to Page {page} while navigating pages.
Files modified:

backend/controllers/referral.controller.js
frontend/src/components/ReferralList.jsx

closes #254

@vercel

vercel Bot commented Jun 4, 2026

Copy link
Copy Markdown

@Aditya8369 is attempting to deploy a commit to the omkarhole's projects Team on Vercel.

A member of the Team first needs to authorize it.

@omkarhole omkarhole merged commit f49c713 into omkarhole:main Jun 4, 2026
0 of 2 checks passed
@omkarhole omkarhole added NSOC'26 Issues for the NSOC 2026 program level3 10 points labels Jun 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

level3 10 points NSOC'26 Issues for the NSOC 2026 program

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[ENHANCE]: Consistent pagination UX and API contract

2 participants