lint
This commit is contained in:
parent
f81a02f5e4
commit
79ea0a2517
|
|
@ -6,18 +6,21 @@ export interface UserFormData {
|
|||
photoProfileUrl: string;
|
||||
email: string;
|
||||
password: string | undefined;
|
||||
roles: string[]
|
||||
roles: string[];
|
||||
}
|
||||
|
||||
const userFormDataSchema = z.object({
|
||||
id: z.string().optional(),
|
||||
name: z.string(),
|
||||
photoProfileUrl: z.union([z.string().url(), z.null(), z.string()]),
|
||||
email: z.string().email(),
|
||||
password: z.string().optional(),
|
||||
roles: z.array(z.string())
|
||||
}).refine((data) => data.id || data.password || data.password!.length >= 8, {
|
||||
message: "Password is required and must be at least 8 characters long if id is empty",
|
||||
path: ["password"],
|
||||
});
|
||||
const userFormDataSchema = z
|
||||
.object({
|
||||
id: z.string().optional(),
|
||||
name: z.string(),
|
||||
photoProfileUrl: z.union([z.string().url(), z.null(), z.string()]),
|
||||
email: z.string().email(),
|
||||
password: z.string().optional(),
|
||||
roles: z.array(z.string()),
|
||||
})
|
||||
.refine((data) => data.id || data.password || data.password!.length >= 8, {
|
||||
message:
|
||||
"Password is required and must be at least 8 characters long if id is empty",
|
||||
path: ["password"],
|
||||
});
|
||||
export default userFormDataSchema;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user