mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-10 23:36:14 -05:00
closes #117 - published order
Fixes the knex query so that posts are correctly returned in the order of published_at, desc
This commit is contained in:
parent
49999a7f15
commit
17c8c02eae
1 changed files with 2 additions and 2 deletions
|
@ -97,7 +97,7 @@
|
|||
limit: 15,
|
||||
where: {},
|
||||
status: 'published',
|
||||
orderBy: 'published_at DESC'
|
||||
orderBy: ['published_at', 'DESC']
|
||||
}, opts);
|
||||
|
||||
postCollection = Posts.forge();
|
||||
|
@ -121,7 +121,7 @@
|
|||
return postCollection
|
||||
.query('limit', opts.limit)
|
||||
.query('offset', opts.limit * (opts.page - 1))
|
||||
.query('orderBy', opts.orderBy)
|
||||
.query('orderBy', opts.orderBy[0], opts.orderBy[1])
|
||||
.fetch(_.omit(opts, 'page', 'limit', 'where', 'status', 'orderBy'))
|
||||
.then(function (collection) {
|
||||
var qb;
|
||||
|
|
Loading…
Add table
Reference in a new issue