feat: inherit all validations from auto-generated zod
This commit is contained in:
1 parent
064c39b7f6
commit
9aa4b0e30d
19 files changed
+372
-224
No files matched your search
@@ -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 };
|
||||
Reference in new issue
Block a user