From 8550116c6bee5add7917344305b8e8f4a0a228aa Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Mon, 31 Aug 2020 20:15:10 -0700 Subject: [PATCH] fix: shares.list should not return shares for deleted documents fix: shares.info should not return info for revoked shares closes #1492 --- server/api/shares.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/server/api/shares.js b/server/api/shares.js index fcb74c1c0..78cdacf1c 100644 --- a/server/api/shares.js +++ b/server/api/shares.js @@ -21,10 +21,12 @@ router.post("shares.info", auth(), async (ctx) => { where: id ? { id, + revokedAt: { [Op.eq]: null }, } : { documentId, userId: user.id, + revokedAt: { [Op.eq]: null }, }, }); if (!share) { @@ -63,6 +65,7 @@ router.post("shares.list", auth(), pagination(), async (ctx) => { { model: Document, required: true, + paranoid: true, as: "document", where: { collectionId: collectionIds,