cal.pub0.org/lib/validations/membership.ts

22 lines
593 B
TypeScript
Raw Normal View History

import { withValidation } from "next-validations";
import { z } from "zod";
import { _MembershipModel as Membership } from "@calcom/prisma/zod";
export const schemaMembershipBaseBodyParams = Membership.omit({});
const schemaMembershipRequiredParams = z.object({
teamId: z.number(),
});
export const schemaMembershipBodyParams = schemaMembershipBaseBodyParams.merge(
schemaMembershipRequiredParams
);
export const schemaMembershipPublic = Membership.omit({});
export const withValidMembership = withValidation({
schema: schemaMembershipBodyParams,
type: "Zod",
mode: "body",
});