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