-
Notifications
You must be signed in to change notification settings - Fork 75
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
[www] Add support for pagination to the proposal list routes #43
Comments
We need to be able to paginate api endpoints for proposal lists. I recommend the approach reddit uses. A list is sorted in some way (let's assume new) To get a page, I specify the limit (max number of items returned) and an optional start/end point. You could have a default limit of 20. For these examples, assume the list is sorted by newest first. To get a page of i items I fetch
To get the next oldest page, I would fetch:
A meta key can be added to the response as a sibling to proposals
|
Pagination should be done like reddit's API, with support for the following:
after
: the id of the last proposal on the previous pagebefore
: used for navigating backwards through the list in the UI, it's the id of the first proposal on the previous pagelimit
: (optional) the number of proposals to fetch in the pageThe text was updated successfully, but these errors were encountered: