feat: inherit all validations from auto-generated zod

This commit is contained in:
Agusti Fernandez Pardo committed 2022-03-30 17:37:51 +02:00
1 parent 064c39b7f6
commit 9aa4b0e30d
19 files changed
+372 -224

No files matched your search

+7 -6
View File
@@ -1,12 +1,13 @@
import { withValidation } from "next-validations";
import { z } from "zod";
const schemaWebhook = z.object({}).strict();
import { _WebhookModel as Webhook } from "@calcom/prisma/zod";
const withValidWebhook = withValidation({
schema: schemaWebhook,
export const schemaWebhookBodyParams = Webhook.omit({ id: true });
export const schemaWebhookPublic = Webhook.omit({});
export const withValidWebhook = withValidation({
schema: schemaWebhookBodyParams,
type: "Zod",
mode: "body",
});
export { schemaWebhook, withValidWebhook };