Legwork for initial documents for atlases

This commit is contained in:
Jori Lallo
2016-07-26 00:05:10 -07:00
parent c88cc1f83b
commit e706e1c77c
6 changed files with 64 additions and 38 deletions

View File

@@ -24,6 +24,7 @@ router.post('atlases.create', auth(), async (ctx) => {
description,
type: type || 'atlas',
teamId: user.teamId,
creatorId: user.id,
});
ctx.body = {
@@ -66,8 +67,8 @@ router.post('atlases.list', auth(), pagination(), async (ctx) => {
// Atlases
let data = [];
await Promise.all(atlases.forEach(async (atlas) => {
data.push(await presentAtlas(atlas, true));
await Promise.all(atlases.map(async (atlas) => {
return data.push(await presentAtlas(atlas, true));
}));
data = _orderBy(data, ['updatedAt'], ['desc']);