fix: hack around create/connect issues for now
parent
9f4a62e2ef
commit
fc795f963b
|
@ -1,7 +1,7 @@
|
||||||
import { withValidation } from "next-validations";
|
import { withValidation } from "next-validations";
|
||||||
import { z } from "zod";
|
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({
|
export const schemaEventTypeCustomInputBaseBodyParams = EventTypeCustomInput.omit({
|
||||||
id: true,
|
id: true,
|
||||||
|
@ -12,10 +12,18 @@ export const schemaEventTypeCustomInputPublic = EventTypeCustomInput.omit({});
|
||||||
|
|
||||||
const schemaEventTypeCustomInputRequiredParams = z.object({
|
const schemaEventTypeCustomInputRequiredParams = z.object({
|
||||||
label: z.string(),
|
label: z.string(),
|
||||||
// uid: z.string(),
|
required: z.boolean(),
|
||||||
eventType: EventTypeModel.optional(),
|
// eventType: EventTypeModel.optional(),
|
||||||
|
type: z.enum(["TEXT", "TEXTLONG", "NUMBER", "BOOL"]),
|
||||||
// eventType: z.instanceof(EventTypeInputModel),
|
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(
|
export const schemaEventTypeCustomInputBodyParams = schemaEventTypeCustomInputBaseBodyParams.merge(
|
||||||
|
|
|
@ -3,8 +3,6 @@ import { z } from "zod";
|
||||||
|
|
||||||
import { _ScheduleModel as Schedule } from "@calcom/prisma/zod";
|
import { _ScheduleModel as Schedule } from "@calcom/prisma/zod";
|
||||||
|
|
||||||
// import { jsonSchema } from "./shared/jsonSchema";
|
|
||||||
|
|
||||||
const schemaScheduleBaseBodyParams = Schedule.omit({ id: true }).partial();
|
const schemaScheduleBaseBodyParams = Schedule.omit({ id: true }).partial();
|
||||||
|
|
||||||
const schemaScheduleRequiredParams = z.object({
|
const schemaScheduleRequiredParams = z.object({
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import { withValidation } from "next-validations";
|
import { withValidation } from "next-validations";
|
||||||
import { z } from "zod";
|
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();
|
export const schemaSelectedCalendarBaseBodyParams = SelectedCalendar.omit({ userId: true }).partial();
|
||||||
|
|
||||||
|
@ -16,6 +16,7 @@ const schemaSelectedCalendarRequiredParams = z.object({
|
||||||
username: z.string().optional(),
|
username: z.string().optional(),
|
||||||
email: z.string().optional(),
|
email: z.string().optional(),
|
||||||
}),
|
}),
|
||||||
|
// FIXME: Provide valid UserModel schema here, but not sure how yet.
|
||||||
create: z.any(),
|
create: z.any(),
|
||||||
}),
|
}),
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue