-
Notifications
You must be signed in to change notification settings - Fork 432
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change from offset & limit to number and size
Change the list-memberships API's pagination query params from `page[offset]` and `page[limit]` to `page[number]` and `page[size]`. This is a better API design because it doesn't enable the client to send nonsensical values. For example `page[offset]=2` and `page[size]=10` is nonsensical because `offset` isn't a multiple of `limit`: what would the `offset` and `limit` for the previous page link be? With `page` and `size` this class of nonsensical requests is no longer possible. This will make it easier to add first, last, prev and next page links to the backend's API responses, as was attempted in this PR (not merged): #9181 If the client supplies a page number that is beyond the end of the group's list of memberships, rather than an error the server simply responds with empty date: { "meta": { "page": { "total": 101 } }, "data": [] } The client can use the `meta.page.total` value to figure out how many pages there should be and re-render its pagination controls. (This can happen for example if members leave the group after pagination controls are rendered: the pagination controls may contain links to pages that no longer exist.)
- Loading branch information
Showing
9 changed files
with
87 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters