This commit is contained in:
Tom Moor
2020-08-31 20:23:51 -07:00
parent 8550116c6b
commit dd0d51dd9d
2 changed files with 54 additions and 2 deletions

View File

@ -171,9 +171,12 @@ router.post("shares.revoke", auth(), async (ctx) => {
const share = await Share.findByPk(id);
authorize(user, "revoke", share);
await share.revoke(user.id);
const document = await Document.findByPk(share.documentId);
if (!document) {
throw new NotFoundError();
}
await share.revoke(user.id);
await Event.create({
name: "shares.revoke",