0
Fork 0
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:
ErisDS 2013-06-16 12:21:49 +01:00
parent 49999a7f15
commit 17c8c02eae

View file

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