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

Add pagination and sorting functionality to API endpoints #53

Merged

Conversation

Guhapriya01
Copy link
Collaborator

@Guhapriya01 Guhapriya01 commented Oct 2, 2024

Description

This pull request implements pagination and sorting functionality for the APIs related to books, members, and borrowings. This enhancement addresses issue #38 and improves the efficiency of data retrieval from the API by allowing users to paginate through large datasets and sort results based on specified fields.

Changes Made

  • Added pagination and sorting capabilities to the following endpoints:
    • GET /api/books
    • GET /api/members
    • GET /api/borrowings
    • GET /api/borrowings/member/{member_id}

Implementation Details

  • Leveraged Spring Data’s Pageable interface to support pagination and sorting.
  • Updated the service and repository layers to accommodate the new functionality.
  • Added query parameters for pagination and sorting:
    • Pagination: page (default: 0), size (default: 5)
    • Sorting: sortBy (field) and sortDir (asc or desc)

Future Work

  • Drafting documentation to describe the new pagination and sorting parameters in the API.

Related Issue

Resolves: #38

If you have any suggestions or recommendations regarding the implementation or documentation, please let me know!

Copy link
Owner

@ajaynegi45 ajaynegi45 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @Guhapriya01,

Thank you for your prompt work on this issue. I appreciate your dedication to the project.

I have reviewed your work, and I'm pleased to inform you that I have merged your pull request. Your changes looks fantastic, and it aligns perfectly with the project's design and usability goals. Great job!

If you have any more contributions or if there's anything else you'd like to work on in the future, please don't hesitate to let us know. Your efforts are valuable to the project's success.

Once again, thank you for your contribution! ❤️

@ajaynegi45 ajaynegi45 merged commit e8905ac into ajaynegi45:main Oct 2, 2024
1 check failed
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.

[FEATURE] Implement Pagination and Sorting for APIs
2 participants