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

20 lines
439 B
TypeScript
Raw Normal View History

import { withValidation } from "next-validations";
import { z } from "zod";
const schemaTeam = z
.object({
slug: z.string().min(3),
name: z.string().min(3),
hideBranding: z.boolean().default(false),
bio: z.string().min(3).optional(),
logo: z.string().optional(),
})
2022-03-30 12:17:55 +00:00
.strict();
const withValidTeam = withValidation({
schema: schemaTeam,
type: "Zod",
mode: "body",
});
export { schemaTeam, withValidTeam };