fix adding managed event type to workflow (#12111)
Co-authored-by: CarinaWolli <wollencarina@gmail.com>pull/10659/head
parent
08d65c85de
commit
09ecd445bb
|
@ -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: {
|
||||||
|
|
Loading…
Reference in New Issue