Skip to content
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 to get-all-waitlist #1303

Conversation

Domfa
Copy link
Contributor

@Domfa Domfa commented Feb 28, 2025

Pull Request

Description

This PR adds pagination support to the getAllWaitlist endpoint in the Waitlist module. The changes include modifying the WaitlistService.getAllWaitlist method to accept optional page and limit query parameters, using these values to calculate skip and take for the TypeORM query, and returning a uniform API response that includes pagination details (current page, total pages, total waitlist count, and waitlist entries). Additionally, the Swagger documentation has been updated to reflect these changes, and the test suite has been updated to validate the new pagination behavior.

Related Issue

Fixes #1233

Type of Change

  • feat: New feature
  • fix: Bug fix
  • docs: Documentation updates
  • style: Code style/formatting changes
  • refactor: Code refactoring
  • perf: Performance improvements
  • test: Test additions/updates
  • chore: Build process or tooling changes
  • ci: CI configuration changes
  • other:

How Has This Been Tested?

  • Unit tests
  • Integration tests
  • Manual tests

Test Evidence

Screenshot 2025-02-28 194414
Screenshot 2025-02-28 194509

Screenshots (if applicable)

Documentation Screenshots (if applicable)

Checklist

  • My code follows the project's coding style
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published
  • I have included a screenshot showing all tests passing
  • I have included documentation screenshots (if applicable)

Additional Notes

This PR refactors the getAllWaitlist method to improve performance and scalability by reducing the amount of data retrieved from the database.

@Domfa Domfa changed the title [FEAT]: add pagination to getAllWaitlist feat : implement pagination to get-all-waitlist Feb 28, 2025
@TheCodeGhinux TheCodeGhinux merged commit 1cf1446 into hngprojects:dev Mar 2, 2025
1 check passed
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.

[FEAT] Pagination for Get All Waitlist
2 participants