0
Fork 0
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:
Sebastian Gierlinger 2014-04-19 17:03:20 +02:00
parent ff5ae21a9e
commit 52197d3a38

View file

@ -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;