You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This issue is a result of the API format discussion in #2362, and is part of a larger project to move our API towards the JSON-API format which is documented in the Epic: #2124. This is one step in the journey towards achieving the Post JSON object format laid out in #2347.
Currently, all of our pagination data is included as top-level items on a response:
There are some additional complexities to this issue, in order to ensure that this response remains consistent throughout the Ghost application and to reduce / remove the need for the post-processing which currently exists in controllers/frontend.js.
The final pagination object expected by themes looks like:
pagination: {
page: #, // The current page number
prev: #, // The previous page number, not present if there is no previous page
next: #, // The next page number, not present if there is no next page
limit: #, // The number of items per page
total: #, // The total number of items available in the complete set
pages: # // The total number of pages available in the complete set
}
All of these properties, some of which are computed, are provided to the theme because themes can't do the math.
These items need to be returned by the API instead of calculated afterwards, so that all apps, themes and internal requests get the same data.
The meta.pagination object can then be passed directly to the theme. For the time being it should be passed as its old name pagination.
The text was updated successfully, but these errors were encountered:
closesTryGhost#2604
- moved ‚pagination‘ to ‚meta‘ property
- added response test for pagination property
- changed ‚next‘ and ‚prev‘ to be set to null and exist on every
response
- removed unnecessary call to API for RSS author
This issue is a result of the API format discussion in #2362, and is part of a larger project to move our API towards the JSON-API format which is documented in the Epic: #2124. This is one step in the journey towards achieving the Post JSON object format laid out in #2347.
Currently, all of our pagination data is included as top-level items on a response:
As part of our move towards JSON-API, these items should all be included in a
meta
object:There are some additional complexities to this issue, in order to ensure that this response remains consistent throughout the Ghost application and to reduce / remove the need for the post-processing which currently exists in controllers/frontend.js.
The final
pagination
object expected by themes looks like:All of these properties, some of which are computed, are provided to the theme because themes can't do the math.
These items need to be returned by the API instead of calculated afterwards, so that all apps, themes and internal requests get the same data.
The
meta.pagination
object can then be passed directly to the theme. For the time being it should be passed as its old namepagination
.The text was updated successfully, but these errors were encountered: