news bugfix: sorting news when paging
This commit is contained in:
1 parent
1ebfcea16b
commit
f687425bdc
1 file changed
+5
-4
+5
-4
@@ -34,10 +34,11 @@ module.exports = function (app) {
|
||||
return p["_id"]+"";
|
||||
});
|
||||
|
||||
var posts = yield db.c("posts").find(query).skip(skip).limit(count).toArray()
|
||||
.then(function (items) {
|
||||
return items.sort(sortNewsByDate);
|
||||
})
|
||||
var posts = yield db.c("posts").find(query)
|
||||
.sort({date: -1})
|
||||
.skip(skip)
|
||||
.limit(count)
|
||||
.toArray()
|
||||
.then(function (items) {
|
||||
return items.filter(function (i) {
|
||||
var id = i["_id"]+"";
|
||||
|
||||
Reference in new issue
Block a user