diff --git a/lib/validations/event-type-custom-input.ts b/lib/validations/event-type-custom-input.ts index 4898af83bd..ea1e80c3bb 100644 --- a/lib/validations/event-type-custom-input.ts +++ b/lib/validations/event-type-custom-input.ts @@ -1,7 +1,7 @@ import { withValidation } from "next-validations"; import { z } from "zod"; -import { EventTypeModel, _EventTypeCustomInputModel as EventTypeCustomInput } from "@calcom/prisma/zod"; +import { _EventTypeCustomInputModel as EventTypeCustomInput } from "@calcom/prisma/zod"; export const schemaEventTypeCustomInputBaseBodyParams = EventTypeCustomInput.omit({ id: true, @@ -12,10 +12,18 @@ export const schemaEventTypeCustomInputPublic = EventTypeCustomInput.omit({}); const schemaEventTypeCustomInputRequiredParams = z.object({ label: z.string(), - // uid: z.string(), - eventType: EventTypeModel.optional(), - - // eventType: z.instanceof(EventTypeInputModel), + required: z.boolean(), + // eventType: EventTypeModel.optional(), + type: z.enum(["TEXT", "TEXTLONG", "NUMBER", "BOOL"]), + eventType: z.object({ + connect: z.object({ + id: z.number().optional(), + // username: z.string().optional(), + // email: z.string().optional(), + }), + // FIXME: Provide valid EventTypeModel schema here, but not sure how yet. + create: z.any(), + }), }); export const schemaEventTypeCustomInputBodyParams = schemaEventTypeCustomInputBaseBodyParams.merge( diff --git a/lib/validations/schedule.ts b/lib/validations/schedule.ts index e71ecbfba8..e5782a08d7 100644 --- a/lib/validations/schedule.ts +++ b/lib/validations/schedule.ts @@ -3,8 +3,6 @@ import { z } from "zod"; import { _ScheduleModel as Schedule } from "@calcom/prisma/zod"; -// import { jsonSchema } from "./shared/jsonSchema"; - const schemaScheduleBaseBodyParams = Schedule.omit({ id: true }).partial(); const schemaScheduleRequiredParams = z.object({ diff --git a/lib/validations/selected-calendar.ts b/lib/validations/selected-calendar.ts index 64eee4e401..4eab89d937 100644 --- a/lib/validations/selected-calendar.ts +++ b/lib/validations/selected-calendar.ts @@ -1,7 +1,7 @@ import { withValidation } from "next-validations"; import { z } from "zod"; -import { _UserModel, _SelectedCalendarModel as SelectedCalendar } from "@calcom/prisma/zod"; +import { _SelectedCalendarModel as SelectedCalendar } from "@calcom/prisma/zod"; export const schemaSelectedCalendarBaseBodyParams = SelectedCalendar.omit({ userId: true }).partial(); @@ -16,6 +16,7 @@ const schemaSelectedCalendarRequiredParams = z.object({ username: z.string().optional(), email: z.string().optional(), }), + // FIXME: Provide valid UserModel schema here, but not sure how yet. create: z.any(), }), }); diff --git a/pages/api/event-type-custom-inputs/[id]/edit.ts.fixme b/pages/api/event-type-custom-inputs/[id]/edit.ts similarity index 100% rename from pages/api/event-type-custom-inputs/[id]/edit.ts.fixme rename to pages/api/event-type-custom-inputs/[id]/edit.ts diff --git a/pages/api/event-type-custom-inputs/new.ts.fixme b/pages/api/event-type-custom-inputs/new.ts similarity index 100% rename from pages/api/event-type-custom-inputs/new.ts.fixme rename to pages/api/event-type-custom-inputs/new.ts