fix: apply withMembership scope in documents.drafts

This commit is contained in:
Apoorv Mishra committed 2023-12-27 22:47:15 +05:30
1 parent 20b4998da8
commit 9ba8b197ce
1 file changed
+1 -7
+1 -7
View File
@@ -380,13 +380,7 @@ router.post(
delete where.updatedAt;
}
const collectionScope: Readonly<ScopeOptions> = {
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,