id -> documentId

This commit is contained in:
Tom Moor
2018-05-24 21:19:38 -07:00
parent e538df0df3
commit c060a5c798
3 changed files with 9 additions and 12 deletions

View File

@ -45,16 +45,16 @@ router.post('shares.list', auth(), pagination(), async ctx => {
});
router.post('shares.create', auth(), async ctx => {
const { id } = ctx.body;
ctx.assertPresent(id, 'id is required');
const { documentId } = ctx.body;
ctx.assertPresent(documentId, 'documentId is required');
const user = ctx.state.user;
const document = await Document.findById(id);
const document = await Document.findById(documentId);
authorize(user, 'share', document);
const [share] = await Share.findOrCreate({
where: {
documentId: document.id,
documentId,
userId: user.id,
teamId: user.teamId,
},