-
Notifications
You must be signed in to change notification settings - Fork 192
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat: Implement pagination on find all invitations endpoint #1262
Merged
TheCodeGhinux
merged 26 commits into
hngprojects:dev
from
G4EVA-dev:feat-implement-pagination-on-findAllInvitations-Endpoint
Mar 2, 2025
Merged
Feat: Implement pagination on find all invitations endpoint #1262
TheCodeGhinux
merged 26 commits into
hngprojects:dev
from
G4EVA-dev:feat-implement-pagination-on-findAllInvitations-Endpoint
Mar 2, 2025
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…ndAndCount method
incredible-phoenix246
previously requested changes
Feb 28, 2025
…AllInvitations-Endpoint
fix: remove createDate and upDate
TheCodeGhinux
approved these changes
Mar 2, 2025
TheCodeGhinux
approved these changes
Mar 2, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Pull Request for implementing pagination on find all invitations endpoint
Description
This PR implements pagination for the findAllInvitations endpoint in the InviteController. The endpoint now accepts optional page and limit query parameters to retrieve a paginated list of invitations. This improves performance and scalability, especially when dealing with a large number of invitations.
Related Issue
Fixes #1243
Type of Change
How Has This Been Tested?
Unit Tests
Added unit tests for the findAllInvitations endpoint to verify:
Default pagination behavior (page=1, limit=10).
Custom pagination parameters (page and limit).
Response format and data correctness.
Manual Tests
Tested the endpoint using SwaggerUI and POSTMAN to ensure it returns the correct paginated response.
Test Evidence
Screenshots (if applicable)
Documentation Screenshots (if applicable)
SWAGGERUI BEFORE FIX:

SWAGGERUI AFTER FIX:

Checklist
Additional Notes
The pagination implementation uses skip and take methods provided by TypeORM to fetch the correct subset of invitations.
Default values for page and limit are set to 1 and 10, respectively, if not provided in the request.
The response format has been standardized to include the total number of invitations for better client-side handling.