Filter private info from public shares

This commit is contained in:
Tom Moor
2018-05-23 23:59:00 -07:00
parent 7eea1a90af
commit e538df0df3
8 changed files with 42 additions and 39 deletions

View File

@ -52,14 +52,14 @@ router.post('shares.create', auth(), async ctx => {
const document = await Document.findById(id);
authorize(user, 'share', document);
const [share, created] = await Share.findOrCreate({
const [share] = await Share.findOrCreate({
where: {
documentId: document.id,
userId: user.id,
teamId: user.teamId,
},
});
console.log('created', created);
share.user = user;
share.document = document;