mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-24 23:48:13 -05:00
Post response move pagination -> meta
closes #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 commit is contained in:
parent
ff5ae21a9e
commit
52197d3a38
1 changed files with 6 additions and 6 deletions
|
@ -67,12 +67,12 @@
|
||||||
|
|
||||||
parse: function (resp) {
|
parse: function (resp) {
|
||||||
if (_.isArray(resp.posts)) {
|
if (_.isArray(resp.posts)) {
|
||||||
this.limit = resp.limit;
|
this.limit = resp.meta.pagination.limit;
|
||||||
this.currentPage = resp.page;
|
this.currentPage = resp.meta.pagination.page;
|
||||||
this.totalPages = resp.pages;
|
this.totalPages = resp.meta.pagination.pages;
|
||||||
this.totalPosts = resp.total;
|
this.totalPosts = resp.meta.pagination.total;
|
||||||
this.nextPage = resp.next;
|
this.nextPage = resp.meta.pagination.next;
|
||||||
this.prevPage = resp.prev;
|
this.prevPage = resp.meta.pagination.prev;
|
||||||
return resp.posts;
|
return resp.posts;
|
||||||
}
|
}
|
||||||
return resp;
|
return resp;
|
||||||
|
|
Loading…
Add table
Reference in a new issue