fix: shares.list should not return shares for deleted documents

fix: shares.info should not return info for revoked shares
closes #1492
This commit is contained in:
Tom Moor 2020-08-31 20:15:10 -07:00
parent 3c7dc93982
commit 8550116c6b

View File

@ -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,