fix: Restore option missing in archived documents

This commit is contained in:
Tom Moor
2019-10-12 13:24:48 -07:00
parent 2d913e3766
commit d4347b6f4b

View File

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