Fixed ordering issue on dashboard
This commit is contained in:
@ -1,6 +1,6 @@
|
|||||||
import Router from 'koa-router';
|
import Router from 'koa-router';
|
||||||
import httpErrors from 'http-errors';
|
import httpErrors from 'http-errors';
|
||||||
import _orderBy from 'lodash.orderby';
|
import _ from 'lodash';
|
||||||
|
|
||||||
import auth from './authentication';
|
import auth from './authentication';
|
||||||
import pagination from './middlewares/pagination';
|
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));
|
return data.push(await presentCollection(ctx, atlas, true));
|
||||||
}));
|
}));
|
||||||
|
|
||||||
data = _orderBy(data, ['updatedAt'], ['desc']);
|
data = _.orderBy(data, ['updatedAt'], ['desc']);
|
||||||
|
|
||||||
ctx.body = {
|
ctx.body = {
|
||||||
pagination: ctx.state.pagination,
|
pagination: ctx.state.pagination,
|
||||||
|
@ -100,6 +100,8 @@ export function presentCollection(ctx, collection, includeRecentDocuments=false)
|
|||||||
name: collection.name,
|
name: collection.name,
|
||||||
description: collection.description,
|
description: collection.description,
|
||||||
type: collection.type,
|
type: collection.type,
|
||||||
|
createdAt: collection.createdAt,
|
||||||
|
updatedAt: collection.updatedAt,
|
||||||
};
|
};
|
||||||
|
|
||||||
if (collection.type === 'atlas') data.navigationTree = collection.navigationTree;
|
if (collection.type === 'atlas') data.navigationTree = collection.navigationTree;
|
||||||
|
Reference in New Issue
Block a user