From d4347b6f4b2c62350acb00e55db8a4b891441006 Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Sat, 12 Oct 2019 13:24:48 -0700 Subject: [PATCH] fix: Restore option missing in archived documents --- server/api/documents.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/server/api/documents.js b/server/api/documents.js index 57d87b61c..9c31d94d8 100644 --- a/server/api/documents.js +++ b/server/api/documents.js @@ -157,7 +157,11 @@ router.post('documents.archived', auth(), pagination(), async ctx => { const user = ctx.state.user; const collectionIds = await user.collectionIds(); - const documents = await Document.findAll({ + const collectionScope = { method: ['withCollection', user.id] }; + const documents = await Document.scope( + 'defaultScope', + collectionScope + ).findAll({ where: { teamId: user.teamId, collectionId: collectionIds,