[chore] added prettier
This commit is contained in:
@@ -9,12 +9,8 @@ import { Atlas } from '../models';
|
||||
|
||||
const router = new Router();
|
||||
|
||||
router.post('collections.create', auth(), async (ctx) => {
|
||||
const {
|
||||
name,
|
||||
description,
|
||||
type,
|
||||
} = ctx.body;
|
||||
router.post('collections.create', auth(), async ctx => {
|
||||
const { name, description, type } = ctx.body;
|
||||
ctx.assertPresent(name, 'name is required');
|
||||
|
||||
const user = ctx.state.user;
|
||||
@@ -32,7 +28,7 @@ router.post('collections.create', auth(), async (ctx) => {
|
||||
};
|
||||
});
|
||||
|
||||
router.post('collections.info', auth(), async (ctx) => {
|
||||
router.post('collections.info', auth(), async ctx => {
|
||||
const { id } = ctx.body;
|
||||
ctx.assertPresent(id, 'id is required');
|
||||
|
||||
@@ -51,25 +47,24 @@ router.post('collections.info', auth(), async (ctx) => {
|
||||
};
|
||||
});
|
||||
|
||||
|
||||
router.post('collections.list', auth(), pagination(), async (ctx) => {
|
||||
router.post('collections.list', auth(), pagination(), async ctx => {
|
||||
const user = ctx.state.user;
|
||||
const collections = await Atlas.findAll({
|
||||
where: {
|
||||
teamId: user.teamId,
|
||||
},
|
||||
order: [
|
||||
['updatedAt', 'DESC'],
|
||||
],
|
||||
order: [['updatedAt', 'DESC']],
|
||||
offset: ctx.state.pagination.offset,
|
||||
limit: ctx.state.pagination.limit,
|
||||
});
|
||||
|
||||
// Atlases
|
||||
let data = [];
|
||||
await Promise.all(collections.map(async (atlas) => {
|
||||
return data.push(await presentCollection(ctx, atlas, true));
|
||||
}));
|
||||
await Promise.all(
|
||||
collections.map(async atlas => {
|
||||
return data.push(await presentCollection(ctx, atlas, true));
|
||||
})
|
||||
);
|
||||
|
||||
data = _.orderBy(data, ['updatedAt'], ['desc']);
|
||||
|
||||
@@ -79,7 +74,7 @@ router.post('collections.list', auth(), pagination(), async (ctx) => {
|
||||
};
|
||||
});
|
||||
|
||||
router.post('collections.updateNavigationTree', auth(), async (ctx) => {
|
||||
router.post('collections.updateNavigationTree', auth(), async ctx => {
|
||||
const { id, tree } = ctx.body;
|
||||
ctx.assertPresent(id, 'id is required');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user