feat: Adds teams endpoints and zod validations
This commit is contained in:
1 parent
f2be36f89c
commit
8b8629f37a
6 files changed
+172
No files matched your search
@@ -0,0 +1,19 @@
|
||||
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(),
|
||||
})
|
||||
.strict(); // Adding strict so that we can disallow passing in extra fields
|
||||
const withValidTeam = withValidation({
|
||||
schema: schemaTeam,
|
||||
type: "Zod",
|
||||
mode: "body",
|
||||
});
|
||||
|
||||
export { schemaTeam, withValidTeam };
|
||||
Reference in new issue
Block a user