Skip to content

178-donors pagination#178

Open
bhuvanh66 wants to merge 2 commits intomainfrom
162-donors-pagination
Open

178-donors pagination#178
bhuvanh66 wants to merge 2 commits intomainfrom
162-donors-pagination

Conversation

@bhuvanh66
Copy link
Copy Markdown
Contributor

ℹ️ Issue

Closes #162

📝 Description

Write a short summary of what you added. Why is it important? Any member of C4C should be able to read this and understand your contribution -- not just your team members.

Adds pagination to GET /donors and introduces a new GET /donations endpoint, both returning a consistent { data, pagination } envelope.

Changes:

Extended GET /donors to support page and limit query params with paginated response
Added GET /donations endpoint with the same pagination support
Both return 400 for invalid params (< 1, non-integer)
Updated response from array to { data: [...] } for consistency
Updated tests to match new shape and added pagination + validation test cases

✔️ Verification

What steps did you take to verify your changes work? These should be clear enough for someone to be able to clone the branch and follow the steps themselves.

Provide screenshots of any new components, styling changes, or pages.

Run unit tests:

cd apps/backend/lambdas/donors && npm test
Test endpoints manually:
GET /donors?page=1&limit=2 → paginated response with pagination object
GET /donors?page=0&limit=1 → 400
GET /donations?page=1&limit=1 → paginated donations

🏕️ (Optional) Future Work / Notes

Did you notice anything ugly during the course of this ticket? Any bugs, design challenges, or unexpected behavior? Write it down so we can clean it up in a future ticket!

@github-actions github-actions bot requested a review from mehanana March 26, 2026 22:10
github-actions bot added a commit that referenced this pull request Mar 26, 2026
@bhuvanh66 bhuvanh66 changed the title donors pagination 178-donors pagination Mar 26, 2026
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.

Pagination for Donors and Donations

1 participant