2022-03-26 23:58:22 +00:00
|
|
|
import { withValidation } from "next-validations";
|
2022-04-02 01:46:24 +00:00
|
|
|
import { z } from "zod";
|
2022-03-26 23:58:22 +00:00
|
|
|
|
2022-03-30 15:37:51 +00:00
|
|
|
import { _DestinationCalendarModel as DestinationCalendar } from "@calcom/prisma/zod";
|
|
|
|
|
2022-04-02 01:46:24 +00:00
|
|
|
export const schemaDestinationCalendarBaseBodyParams = DestinationCalendar.omit({ id: true }).partial();
|
|
|
|
|
|
|
|
const schemaDestinationCalendarRequiredParams = z.object({
|
|
|
|
integration: z.string(),
|
|
|
|
externalId: z.string(),
|
|
|
|
});
|
|
|
|
|
|
|
|
export const schemaDestinationCalendarBodyParams = schemaDestinationCalendarBaseBodyParams.merge(
|
|
|
|
schemaDestinationCalendarRequiredParams
|
|
|
|
);
|
2022-03-30 15:37:51 +00:00
|
|
|
|
|
|
|
export const schemaDestinationCalendarPublic = DestinationCalendar.omit({});
|
|
|
|
|
|
|
|
export const withValidDestinationCalendar = withValidation({
|
|
|
|
schema: schemaDestinationCalendarBodyParams,
|
2022-03-26 23:58:22 +00:00
|
|
|
type: "Zod",
|
|
|
|
mode: "body",
|
|
|
|
});
|