perf: rename eventTypes.heavy to eventTypesHeavy (#24630)
Post release / release (push) Canceled after 0s
Post release / release (push) Canceled after 0s
* Rename eventTypes.heavy to eventTypesHeavy * Update eventTypes lib types * Remove trpc and trpc client heavy resolve endpoint * Update shared file * Fix comments * Rename path * Fix wait for URL path * Fix API endpoint in event-types.e2e.ts test * fix: Import WorkflowType from enums instead of client The WorkflowType enum should be imported from @calcom/prisma/enums rather than @calcom/prisma/client. This was causing integration tests to fail with 'Cannot read properties of undefined (reading EVENT_TYPE)' because the enum wasn't being properly exported from the client. This fixes the remaining integration test failures after the Prisma 6.16 upgrade. Co-Authored-By: [email protected] <[email protected]> --------- Co-authored-by: Keith Williams <[email protected]> Co-authored-by: Anik Dhabal Babu <[email protected]> Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Co-authored-by: [email protected] <[email protected]>
This commit is contained in:
23 files changed
+34
-47
No files matched your search
@@ -16,7 +16,7 @@ export const ENDPOINTS = [
|
||||
"deploymentSetup",
|
||||
"dsync",
|
||||
"eventTypes",
|
||||
"eventTypes/heavy",
|
||||
"eventTypesHeavy",
|
||||
"features",
|
||||
"i18n",
|
||||
"insights",
|
||||
|
||||
@@ -27,7 +27,6 @@ const resolveEndpoint = (links: any) => {
|
||||
// to the correct API endpoints.
|
||||
// - viewer.me - 2 segment paths like this are for logged in requests
|
||||
// - viewer.public.i18n - 3 segments paths can be public or authed
|
||||
// - viewer.eventTypes.heavy.create - 4 segments paths for heavy sub-router
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
return (ctx: any) => {
|
||||
const parts = ctx.op.path.split(".");
|
||||
@@ -36,9 +35,6 @@ const resolveEndpoint = (links: any) => {
|
||||
if (parts.length == 2) {
|
||||
endpoint = parts[0] as keyof typeof links;
|
||||
path = parts[1];
|
||||
} else if (parts.length >= 3 && parts[2] === "heavy") {
|
||||
endpoint = parts[1] + "/heavy" as keyof typeof links;
|
||||
path = parts[3];
|
||||
} else {
|
||||
endpoint = parts[1] as keyof typeof links;
|
||||
path = parts.splice(2, parts.length - 2).join(".");
|
||||
|
||||
@@ -2,7 +2,7 @@ import { userAdminRouter } from "@calcom/features/ee/users/server/trpc-router";
|
||||
import { featureFlagRouter } from "@calcom/features/flags/server/router";
|
||||
import { insightsRouter } from "@calcom/features/insights/server/trpc-router";
|
||||
|
||||
import { router, mergeRouters } from "../../trpc";
|
||||
import { router } from "../../trpc";
|
||||
import app_RoutingForms from "../apps/routing-forms/_router";
|
||||
import { loggedInViewerRouter } from "../loggedInViewer/_router";
|
||||
import { publicViewerRouter } from "../publicViewer/_router";
|
||||
@@ -53,12 +53,8 @@ export const viewerRouter = router({
|
||||
calendars: calendarsRouter,
|
||||
calVideo: calVideoRouter,
|
||||
credentials: credentialsRouter,
|
||||
eventTypes: mergeRouters(
|
||||
eventTypesRouter,
|
||||
router({
|
||||
heavy: heavyEventTypesRouter,
|
||||
})
|
||||
),
|
||||
eventTypes: eventTypesRouter,
|
||||
eventTypesHeavy: heavyEventTypesRouter,
|
||||
availability: availabilityRouter,
|
||||
teams: viewerTeamsRouter,
|
||||
timezones: timezonesRouter,
|
||||
|
||||
@@ -27,10 +27,10 @@ import { getTeamIdFromEventType } from "@calcom/lib/getTeamIdFromEventType";
|
||||
import { getTranslation } from "@calcom/lib/server/i18n";
|
||||
import { getTimeFormatStringFromUserTimeFormat } from "@calcom/lib/timeFormat";
|
||||
import prisma from "@calcom/prisma";
|
||||
import { WorkflowType as PrismaWorkflowType, type Workflow } from "@calcom/prisma/client";
|
||||
import type { Workflow } from "@calcom/prisma/client";
|
||||
import type { Prisma, WorkflowStep } from "@calcom/prisma/client";
|
||||
import type { TimeUnit } from "@calcom/prisma/enums";
|
||||
import { WorkflowTemplates } from "@calcom/prisma/enums";
|
||||
import { WorkflowTemplates, WorkflowType as PrismaWorkflowType } from "@calcom/prisma/enums";
|
||||
import { SchedulingType } from "@calcom/prisma/enums";
|
||||
import { BookingStatus, MembershipRole, WorkflowActions, WorkflowTriggerEvents } from "@calcom/prisma/enums";
|
||||
import { EventTypeMetaDataSchema } from "@calcom/prisma/zod-utils";
|
||||
|
||||
Reference in new issue
Block a user