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: Add users collection pagination #636

Merged
merged 12 commits into from
Feb 22, 2025

Conversation

Zen-cronic
Copy link
Contributor

Fixes #625

Changes

  • Update knex query for pagination
  • Add tests for hal.collection

Copy link
Member

@evert evert left a comment

Choose a reason for hiding this comment

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

great progress!

Copy link
Contributor

@usrrname usrrname left a comment

Choose a reason for hiding this comment

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

Ahh rad you added tests!!

@Zen-cronic
Copy link
Contributor Author

Zen-cronic commented Feb 20, 2025

Ahh rad you added tests!!

as always :))
ngl, this repo warrants wayy more tests - both unit & e2e. so, i'll keep adding more!

@Zen-cronic
Copy link
Contributor Author

Zen-cronic commented Feb 20, 2025

progress update:

  • implemented pagination directly from the query

1st page:

two-pages-first

2nd page:

two-pages-second

TODO:

  • try with more pages (more dummy users)
  • add tests for db query
  • implement first and last page

@evert
Copy link
Member

evert commented Feb 20, 2025

Awesome, this is looking great!

@Zen-cronic
Copy link
Contributor Author

both previous and next buttons verified:

2nd page of total 3 pages:
three-pages-second

Signed-off-by: Kaung Zin Hein <[email protected]>
@Zen-cronic
Copy link
Contributor Author

First and last page links implemented:

On the 1st page:

first-page-first-last

On the last page:

last-page-first-last

On a middle page:

middle-page-first-last

Copy link
Member

@evert evert left a comment

Choose a reason for hiding this comment

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

Thank you! I feel inspired. I've been putting off database tests and looking at this I feel silly for not diving in.

@Zen-cronic Zen-cronic marked this pull request as ready for review February 21, 2025 16:41
Copy link
Member

@evert evert left a comment

Choose a reason for hiding this comment

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

Great work!

@evert evert merged commit 737be45 into curveball:main Feb 22, 2025
12 checks 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.

Paging for the user collection
3 participants