mirror of
https://github.com/mosh-hamedani/helpdesk.git
synced 2026-05-21 11:58:19 +02:00
21 lines
683 B
TypeScript
21 lines
683 B
TypeScript
import { z } from "zod/v4";
|
|
|
|
export const createUserSchema = z.object({
|
|
name: z.string().trim().min(3, "Name must be at least 3 characters"),
|
|
email: z.email("Invalid email address"),
|
|
password: z.string().trim().min(8, "Password must be at least 8 characters"),
|
|
});
|
|
|
|
export type CreateUserInput = z.infer<typeof createUserSchema>;
|
|
|
|
export const updateUserSchema = z.object({
|
|
name: z.string().trim().min(3, "Name must be at least 3 characters"),
|
|
email: z.email("Invalid email address"),
|
|
password: z.union([
|
|
z.literal(""),
|
|
z.string().trim().min(8, "Password must be at least 8 characters"),
|
|
]),
|
|
});
|
|
|
|
export type UpdateUserInput = z.infer<typeof updateUserSchema>;
|