Fixed ordering by issues

This commit is contained in:
Jori Lallo
2016-05-25 21:32:59 -07:00
parent 4c6964ad07
commit 22668f3acf
2 changed files with 3 additions and 2 deletions

View File

@@ -1,6 +1,6 @@
import Router from 'koa-router';
import httpErrors from 'http-errors';
import _orderBy from 'lodash/orderBy';
import _orderBy from 'lodash/orderby';
import auth from './authentication';
import pagination from './middlewares/pagination';

View File

@@ -1,3 +1,4 @@
import _orderBy from 'lodash/orderby';
import Document from './models/Document';
export function presentUser(user) {
@@ -45,7 +46,7 @@ export function presentAtlas(atlas, includeRecentDocuments=false) {
await Promise.all(documents.map(async (document) => {
recentDocuments.push(await presentDocument(document, true));
}))
data.recentDocuments = recentDocuments;
data.recentDocuments = _orderBy(recentDocuments, ['updatedAt'], ['desc']);
}
resolve(data);