diff --git a/server/api/collections.js b/server/api/collections.js index b86b2bf2..3cb9a0b9 100644 --- a/server/api/collections.js +++ b/server/api/collections.js @@ -1,6 +1,6 @@ import Router from 'koa-router'; import httpErrors from 'http-errors'; -import _orderBy from 'lodash.orderby'; +import _ from 'lodash'; import auth from './authentication'; import pagination from './middlewares/pagination'; @@ -71,7 +71,7 @@ router.post('collections.list', auth(), pagination(), async (ctx) => { return data.push(await presentCollection(ctx, atlas, true)); })); - data = _orderBy(data, ['updatedAt'], ['desc']); + data = _.orderBy(data, ['updatedAt'], ['desc']); ctx.body = { pagination: ctx.state.pagination, diff --git a/server/presenters.js b/server/presenters.js index 83e64f87..0eb99a51 100644 --- a/server/presenters.js +++ b/server/presenters.js @@ -100,6 +100,8 @@ export function presentCollection(ctx, collection, includeRecentDocuments=false) name: collection.name, description: collection.description, type: collection.type, + createdAt: collection.createdAt, + updatedAt: collection.updatedAt, }; if (collection.type === 'atlas') data.navigationTree = collection.navigationTree;