Add a pager, effective when header supplied, on Storage Collections
example endpoint: https://localhost:7230/1/collections/b157e325-3fe5-459b-8b80-b7a62213334a?page=1&pageSize=100
Implement paging params in the API
Use Hydra paging mechanism
Update database calls to correctly page data
Allow pageSize to be retrieved from GET
Set a default pageSize
Set a max pageSize from settings
From the PR (linked below)
This PR resolves #8
In order to support paging, this PR adds a set of query params to GET storage collections. These are as follows:
page
sets the current page to be looked at
pageSize
How large each page should be
There are also default page sizes (set to 100 by default) and max page page sizes (1000 by default) which can be set in settings.
The default page size is used when no query params are set, and the max automatically overrides any value larger than it to the max, so that we avoid requests for millions of items in a single page
Additionally, ordering has been added to paging, so that retrieved items are consistent. There are 2 query params that support this:
orderBy
this the default
orderByDescending
You can order on the current fields:
created
this is the default
id
slug
An example of using these query params would be something like the following:
Add a pager, effective when header supplied, on Storage Collections
example endpoint:
https://localhost:7230/1/collections/b157e325-3fe5-459b-8b80-b7a62213334a?page=1&pageSize=100
From the PR (linked below)
This PR resolves #8
In order to support paging, this PR adds a set of query params to GET storage collections. These are as follows:
page
pageSize
There are also default page sizes (set to 100 by default) and max page page sizes (1000 by default) which can be set in settings.
The default page size is used when no query params are set, and the max automatically overrides any value larger than it to the max, so that we avoid requests for millions of items in a single page
Additionally, ordering has been added to paging, so that retrieved items are consistent. There are 2 query params that support this:
orderBy
orderByDescending
You can order on the current fields:
created
id
slug
An example of using these query params would be something like the following:
This PR also adds the values
next
andlast
toview
, which will appear when there are more, and/or previous pages to view