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(transactions): added pagination to transactions #208

Merged
merged 3 commits into from
Oct 5, 2022

Conversation

NuttyShrimp
Copy link
Member

First time writing in this language so I'm open for criticism.

Adds the limit= and start= query parameters to the /api/v1/users/USERNAME/transactions endpoint.

closes #114

@NuttyShrimp NuttyShrimp force-pushed the feat/paginated-transactions-api branch from 60694cf to 3b924ab Compare October 4, 2022 23:13
@TomNaessens
Copy link
Member

Would be nice to have these tested and added to the API specs at https://github.com/ZeusWPI/Tab/blob/master/spec/integration/api/v1/transactions_controller_spec.rb. This spec will automatically generate a swagger so users are aware the params exist.

It's not explicitly needed to check for the params existence, using limit and offset with nil will just return everything.
Looking good otherwise!

@NuttyShrimp
Copy link
Member Author

i've added the test (after some struggles) and also added ordering to the transactions. It think that's logical change to prevent users from getting unordered list's but I'm not sure if it is required to explicitly order by id

Copy link
Member

@TomNaessens TomNaessens left a comment

Choose a reason for hiding this comment

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

Looking good!

@NuttyShrimp NuttyShrimp merged commit e21a000 into master Oct 5, 2022
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.

Add a paginated transactions API endpoint
2 participants