Fixed ordering by issues
This commit is contained in:
@@ -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';
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user