diff --git a/applications/server/src/store/command-group-resolvers.ts b/applications/server/src/store/command-group-resolvers.ts index 02c63499..3428f014 100644 --- a/applications/server/src/store/command-group-resolvers.ts +++ b/applications/server/src/store/command-group-resolvers.ts @@ -60,10 +60,12 @@ export class CommandGroupResolvers { const em = await connectToProjectEmOrFail(campaignId, ctx); let commandGroups: CommandGroup[] = []; if (commandGroupIds?.length) { - const query: FilterQuery = { - id: commandGroupIds, - commands: { ...beaconHidden(hidden) }, - }; + const query: FilterQuery = hidden + ? { id: commandGroupIds } + : { + id: commandGroupIds, + commands: { ...beaconHidden(hidden) }, + }; commandGroups = await em.find(CommandGroup, query, { populate: relationPaths, orderBy: filter,