22 lines
593 B
TypeScript
22 lines
593 B
TypeScript
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",
|
|
});
|