1 parent
8c24c5c714
commit
6ba70a7259
10 files changed
+241
-258
No files matched your search
@@ -1,27 +1,13 @@
|
||||
import { z } from "zod";
|
||||
|
||||
import { _EventTypeCustomInputModel as EventTypeCustomInput } from "@calcom/prisma/zod";
|
||||
|
||||
export const schemaEventTypeCustomInputBaseBodyParams = EventTypeCustomInput.omit({
|
||||
id: true,
|
||||
eventTypeId: true,
|
||||
}).partial();
|
||||
});
|
||||
|
||||
export const schemaEventTypeCustomInputPublic = EventTypeCustomInput.omit({});
|
||||
|
||||
const schemaEventTypeCustomInputRequiredParams = z.object({
|
||||
label: z.string(),
|
||||
required: z.boolean(),
|
||||
type: z.enum(["TEXT", "TEXTLONG", "NUMBER", "BOOL"]),
|
||||
eventType: z.object({
|
||||
connect: z.object({
|
||||
id: z.number().optional(),
|
||||
}),
|
||||
// FIXME: Provide valid EventTypeModel schema here, but not sure how yet.
|
||||
create: z.any(),
|
||||
}),
|
||||
});
|
||||
export const schemaEventTypeCustomInputBodyParams = schemaEventTypeCustomInputBaseBodyParams.strict();
|
||||
|
||||
export const schemaEventTypeCustomInputBodyParams = schemaEventTypeCustomInputBaseBodyParams.merge(
|
||||
schemaEventTypeCustomInputRequiredParams
|
||||
);
|
||||
export const schemaEventTypeCustomInputEditBodyParams = schemaEventTypeCustomInputBaseBodyParams
|
||||
.partial()
|
||||
.strict();
|
||||
Reference in new issue
Block a user