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,