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(pagination): add paginate function to calculate offset, limit, and total pages in get_table handler #26

Merged
merged 3 commits into from
Nov 20, 2024

Conversation

Yunnie-pin
Copy link
Contributor

Refactored get_table handler to use a paginate function, which centralizes the calculation of pagination values (offset, limit, total pages) based on provided page and limit query parameters and the total count of records.

Thisimproves code readability and reusability by encapsulating pagination logic.

Copy link
Member

@jhheider jhheider left a comment

Choose a reason for hiding this comment

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

looks good; I'd move lines L62-63 down to L70, to keep it all together. or pass query to paginate (and move all of it inside).

Copy link
Member

@sanchitram1 sanchitram1 left a comment

Choose a reason for hiding this comment

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

pagination!

@jhheider jhheider merged commit da445c5 into teaxyz:main Nov 20, 2024
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.

4 participants