fix adding managed event type to workflow (#12111)

Co-authored-by: CarinaWolli <[email protected]>
This commit is contained in:
Carina WollendorferandCarinaWolli authored and GitHub committed 2023-10-27 17:30:34 +05:30
1 parent 08d65c85de
commit 09ecd445bb
1 file changed
+9 -6
@@ -86,13 +86,16 @@ export const updateHandler = async ({ ctx, input }: UpdateOptions) => {
const hasOrgsPlan = IS_SELF_HOSTED || ctx.user.organizationId;
const where: Prisma.EventTypeWhereInput = {};
where.id = {
in: activeOn,
};
if (userWorkflow.teamId) {
//all children managed event types are added after
where.parentId = null;
}
const activeOnEventTypes = await ctx.prisma.eventType.findMany({
where: {
id: {
in: activeOn,
},
parentId: null,
},
where,
select: {
id: true,
children: {