New database with migrations

This commit is contained in:
Jori Lallo
2016-06-20 00:18:03 -07:00
parent f2732aacab
commit 24e02bfdc4
12 changed files with 361 additions and 49 deletions

View File

@@ -13,11 +13,11 @@ router.post('atlases.info', auth(), async (ctx) => {
let { id } = ctx.request.body;
ctx.assertPresent(id, 'id is required');
const team = await ctx.state.user.getTeam();
const user = ctx.state.user;
const atlas = await Atlas.findOne({
where: {
id: id,
teamId: team.id,
teamId: user.teamId,
},
});
@@ -30,10 +30,10 @@ router.post('atlases.info', auth(), async (ctx) => {
router.post('atlases.list', auth(), pagination(), async (ctx) => {
const team = await ctx.state.user.getTeam();
const user = ctx.state.user;
const atlases = await Atlas.findAll({
where: {
teamId: team.id,
teamId: user.teamId,
},
order: [
['updatedAt', 'DESC'],