mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-24 23:48:13 -05:00
API refactor / cleanup
closes #1303 - removed where and orderBy from being passed from the API through to bookshelf, and ultimately knex - ordering is now consistent across both front and backend, which fixes #1303 - validated / cleaned up all the API parameters - added API tests for the status and staticPages parameters
This commit is contained in:
parent
b62923633b
commit
1565c0004b
2 changed files with 2 additions and 3 deletions
|
@ -36,7 +36,7 @@
|
|||
blog: function () {
|
||||
var posts = new Ghost.Collections.Posts();
|
||||
NProgress.start();
|
||||
posts.fetch({ data: { status: 'all', orderBy: ['updated_at', 'DESC'], where: { page: 'all' } } }).then(function () {
|
||||
posts.fetch({ data: { status: 'all', staticPages: 'all'} }).then(function () {
|
||||
Ghost.currentView = new Ghost.Views.Blog({ el: '#main', collection: posts });
|
||||
NProgress.done();
|
||||
});
|
||||
|
|
|
@ -94,8 +94,7 @@
|
|||
data: {
|
||||
status: 'all',
|
||||
page: (self.collection.currentPage + 1),
|
||||
where: { page: 'all' },
|
||||
orderBy: ['updated_at', 'DESC']
|
||||
staticPages: 'all'
|
||||
}
|
||||
}).then(function onSuccess(response) {
|
||||
/*jslint unparam:true*/
|
||||
|
|
Loading…
Add table
Reference in a new issue