feat: re-routing latest page have items #916
Open
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.
Re-routing get the latest page that has items with the option
routingLatest
Description
72082
pages and ten items per page, a total of720821
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
Result without option routingLatest
After re-routing with option routingLatest
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