From 9ba8b197ced291239900bd756bb7d9e291391d47 Mon Sep 17 00:00:00 2001 From: Apoorv Mishra Date: Tue, 26 Sep 2023 12:05:40 +0530 Subject: [PATCH] fix: apply withMembership scope in documents.drafts --- server/routes/api/documents/documents.ts | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/server/routes/api/documents/documents.ts b/server/routes/api/documents/documents.ts index fbff33092a..9b069b07ff 100644 --- a/server/routes/api/documents/documents.ts +++ b/server/routes/api/documents/documents.ts @@ -380,13 +380,7 @@ router.post( delete where.updatedAt; } - const collectionScope: Readonly = { - method: ["withCollectionPermissions", user.id], - }; - const documents = await Document.scope([ - "defaultScope", - collectionScope, - ]).findAll({ + const documents = await Document.defaultScopeWithUser(user.id).findAll({ where, order: [[sort, direction]], offset: ctx.state.pagination.offset,