Skip to content
This repository has been archived by the owner on Oct 20, 2023. It is now read-only.

Commit

Permalink
fix commandGroup query (#70)
Browse files Browse the repository at this point in the history
  • Loading branch information
sharplessHQ authored Jan 21, 2023
1 parent a2fbb65 commit 5f7857b
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions applications/server/src/store/command-group-resolvers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,12 @@ export class CommandGroupResolvers {
const em = await connectToProjectEmOrFail(campaignId, ctx);
let commandGroups: CommandGroup[] = [];
if (commandGroupIds?.length) {
const query: FilterQuery<CommandGroup> = {
id: commandGroupIds,
commands: { ...beaconHidden(hidden) },
};
const query: FilterQuery<CommandGroup> = hidden
? { id: commandGroupIds }
: {
id: commandGroupIds,
commands: { ...beaconHidden(hidden) },
};
commandGroups = await em.find(CommandGroup, query, {
populate: relationPaths,
orderBy: filter,
Expand Down

0 comments on commit 5f7857b

Please sign in to comment.