fix: Include withDrafts in groupMemberships.list

This commit is contained in:
Tom Moor committed 2025-05-03 10:36:22 -04:00
1 parent 0b27487c61
commit e30829e68a
1 file changed
+7 -5
@@ -58,11 +58,13 @@ router.post(
const documentIds = memberships
.map((p) => p.documentId)
.filter(Boolean) as string[];
const documents = await Document.withUserScope(userId).findAll({
where: {
id: documentIds,
},
});
const documents = await Document.withUserScope(userId)
.scope("withDrafts")
.findAll({
where: {
id: documentIds,
},
});
const groups = uniqBy(
memberships.map((membership) => membership.group),