diff --git a/server/routes/api/collections.ts b/server/routes/api/collections.ts index 369737527..56baf0ecb 100644 --- a/server/routes/api/collections.ts +++ b/server/routes/api/collections.ts @@ -761,12 +761,18 @@ router.post( auth(), pagination(), async (ctx: APIContext) => { + const { includeListOnly } = ctx.request.body; const { user } = ctx.state.auth; const collectionIds = await user.collectionIds(); - const where: WhereOptions = { - teamId: user.teamId, - id: collectionIds, - }; + const where: WhereOptions = + includeListOnly && user.isAdmin + ? { + teamId: user.teamId, + } + : { + teamId: user.teamId, + id: collectionIds, + }; const collections = await Collection.scope({ method: ["withMembership", user.id], }).findAll({