Refactor code
This commit is contained in:
16
src/schemas/users.ts
Normal file
16
src/schemas/users.ts
Normal file
@ -0,0 +1,16 @@
|
||||
import { z } from "zod/v4";
|
||||
|
||||
export const createUserSchema = z.object({
|
||||
name: z.string().min(1).max(200),
|
||||
email: z.string().email().max(320),
|
||||
password: z.string().min(8).max(128),
|
||||
role: z.enum(["user", "admin"]).default("user"),
|
||||
});
|
||||
|
||||
export type CreateUserInput = z.infer<typeof createUserSchema>;
|
||||
|
||||
export const resendVerificationSchema = z.object({
|
||||
email: z.string().email(),
|
||||
});
|
||||
|
||||
export type ResendVerificationInput = z.infer<typeof resendVerificationSchema>;
|
||||
Reference in New Issue
Block a user