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

19 lines
515 B
TypeScript
Raw Normal View History

import { withValidation } from "next-validations";
import { z } from "zod";
import { _TeamModel as Team } from "@calcom/prisma/zod";
export const schemaTeamBaseBodyParams = Team.omit({ id: true }).partial();
2022-04-02 01:47:41 +00:00
const schemaTeamRequiredParams = z.object({});
export const schemaTeamBodyParams = schemaTeamBaseBodyParams.merge(schemaTeamRequiredParams);
export const schemaTeamPublic = Team.omit({});
export const withValidTeam = withValidation({
schema: schemaTeamBodyParams,
type: "Zod",
mode: "body",
});