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: re-routing latest page have items #916

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

TonyDo99
Copy link

@TonyDo99 TonyDo99 commented Jan 11, 2025

Re-routing get the latest page that has items with the option routingLatest

Description

  • I found that we do not have the option to check and get the latest page has items. Let's give one scenario like this. At the front-end team, we do have 72082 pages and ten items per page, a total of 720821 items exist on the database. Suddenly one item is deleted by someone right at the moment another clicks to the latest page it probably returns empty items and the mismatch total page was calculated.

Example UI pagination

Screenshot 2025-01-11 at 18 15 57

Result without option routingLatest

Screenshot 2025-01-11 at 18 27 57

After re-routing with option routingLatest

  • It auto return the latest page have items
Screenshot 2025-01-11 at 18 29 43

Affected areas

modified: src/tests/paginate-raw-and-entities.spec.ts
modified: src/tests/paginate-raw.spec.ts
modified: src/tests/paginate.query.builder.spec.ts
modified: src/interfaces/index.ts
modified: src/paginate.ts

Test coverage

Screenshot 2025-01-11 at 18 30 42

@TonyDo99 TonyDo99 force-pushed the feature/routing_latest_page_have_items branch from 1579546 to a3a6899 Compare January 11, 2025 11:42
@TonyDo99
Copy link
Author

TonyDo99 commented Jan 14, 2025

Hi @bashleigh. Could you take a look at this feature?

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.

1 participant