From 21500c7047a75cc9ce35d228e0f52c75c499885d Mon Sep 17 00:00:00 2001 From: Keith Williams Date: Tue, 27 Jan 2026 15:23:26 -0300 Subject: [PATCH] fix: remove _count children query from EventType and Workflow repositories (#27309) Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> --- .../workflows/components/WorkflowListPage.tsx | 31 ++++++----------- packages/features/ee/workflows/lib/types.ts | 3 -- .../repositories/WorkflowRepository.ts | 34 ++++--------------- .../repositories/eventTypeRepository.ts | 10 ------ .../routers/viewer/eventTypes/get.handler.ts | 1 + 5 files changed, 18 insertions(+), 61 deletions(-) diff --git a/apps/web/modules/ee/workflows/components/WorkflowListPage.tsx b/apps/web/modules/ee/workflows/components/WorkflowListPage.tsx index 2f286e388d..6b392a1d4d 100644 --- a/apps/web/modules/ee/workflows/components/WorkflowListPage.tsx +++ b/apps/web/modules/ee/workflows/components/WorkflowListPage.tsx @@ -1,8 +1,3 @@ -import { useAutoAnimate } from "@formkit/auto-animate/react"; -import Link from "next/link"; -import { useRouter } from "next/navigation"; -import { useState } from "react"; - import { getActionIcon } from "@calcom/features/ee/workflows/lib/getActionIcon"; import type { WorkflowListType } from "@calcom/features/ee/workflows/lib/types"; import { getPlaceholderAvatar } from "@calcom/lib/defaultAvatarImage"; @@ -23,7 +18,10 @@ import { } from "@calcom/ui/components/dropdown"; import { Icon } from "@calcom/ui/components/icon"; import { Tooltip } from "@calcom/ui/components/tooltip"; - +import { useAutoAnimate } from "@formkit/auto-animate/react"; +import Link from "next/link"; +import { useRouter } from "next/navigation"; +import { useState } from "react"; import { DeleteDialog } from "./DeleteDialog"; /** @deprecated Use WorkflowListType from ../lib/types instead */ @@ -102,12 +100,12 @@ export default function WorkflowListPage({ workflows }: Props) { {workflow.name ? workflow.name : workflow.steps[0] - ? `Untitled (${`${t(`${workflow.steps[0].action.toLowerCase()}_action`)}` - .charAt(0) - .toUpperCase()}${`${t( - `${workflow.steps[0].action.toLowerCase()}_action` - )}`.slice(1)})` - : "Untitled"} + ? `Untitled (${`${t(`${workflow.steps[0].action.toLowerCase()}_action`)}` + .charAt(0) + .toUpperCase()}${`${t( + `${workflow.steps[0].action.toLowerCase()}_action` + )}`.slice(1)})` + : "Untitled"}
{(workflow.permissions?.readOnly ?? workflow.readOnly) && ( @@ -147,14 +145,7 @@ export default function WorkflowListPage({ workflows }: Props) { (workflow.teamId ? wf.eventType.parentId === null : true)) - .map((activeOn, key) => ( -

- {activeOn.eventType.title} - {activeOn.eventType._count.children > 0 - ? ` (+${activeOn.eventType._count.children})` - : ""} -

- ))}> + .map((activeOn, key) =>

{activeOn.eventType.title}

)}>