fix adding managed event type to workflow (#12111)

Co-authored-by: CarinaWolli <wollencarina@gmail.com>
pull/10659/head
Carina Wollendorfer 2023-10-27 08:00:34 -04:00 committed by GitHub
parent 08d65c85de
commit 09ecd445bb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 6 deletions

View File

@ -86,13 +86,16 @@ export const updateHandler = async ({ ctx, input }: UpdateOptions) => {
const hasOrgsPlan = IS_SELF_HOSTED || ctx.user.organizationId; const hasOrgsPlan = IS_SELF_HOSTED || ctx.user.organizationId;
const activeOnEventTypes = await ctx.prisma.eventType.findMany({ const where: Prisma.EventTypeWhereInput = {};
where: { where.id = {
id: {
in: activeOn, in: activeOn,
}, };
parentId: null, if (userWorkflow.teamId) {
}, //all children managed event types are added after
where.parentId = null;
}
const activeOnEventTypes = await ctx.prisma.eventType.findMany({
where,
select: { select: {
id: true, id: true,
children: { children: {