diff --git a/core/admin/controllers/index.js b/core/admin/controllers/index.js index 14afb4633a..bb7dde14f6 100755 --- a/core/admin/controllers/index.js +++ b/core/admin/controllers/index.js @@ -132,12 +132,12 @@ } }, 'content': function (req, res) { - api.posts.browse() - .then(function (posts) { + api.posts.browse({status: req.params.status || 'all'}) + .then(function (page) { res.render('content', { bodyClass: 'manage', adminNav: setSelected(adminNavbar, 'content'), - posts: posts.toJSON() + posts: page.posts }); }); }, diff --git a/core/frontend/controllers/index.js b/core/frontend/controllers/index.js index 8213e550ff..4815865c83 100644 --- a/core/frontend/controllers/index.js +++ b/core/frontend/controllers/index.js @@ -14,8 +14,8 @@ frontendControllers = { 'homepage': function (req, res) { - api.posts.browse().then(function (posts) { - ghost.doFilter('prePostsRender', posts.toJSON(), function (posts) { + api.posts.browse().then(function (page) { + ghost.doFilter('prePostsRender', page.posts, function (posts) { res.render('index', {posts: posts, ghostGlobals: res.locals.ghostGlobals, navItems: res.locals.navItems}); }); }); diff --git a/core/shared/api.js b/core/shared/api.js index f30ebc7ec6..7f62b9de09 100644 --- a/core/shared/api.js +++ b/core/shared/api.js @@ -22,7 +22,7 @@ // # Posts posts = { // takes filter / pagination parameters - // returns a list of posts in a json response + // returns a page of posts in a json response browse: function (options) { return dataProvider.Post.findPage(options); },