Open wangzhipeng-vicky opened 1 month ago
I used refine, and if the validation fails and I can't retrieve the message, as in my code below what should I do
export const zr_colorsize_reset_pwd_FormScheme = z.object({ oldPwd: z.string().min(8, { message: "8+ characters required" }).trim(), newPwd: z.string().min(8, { message: "8+ characters required" }).trim(), confirmPwd: z.string().min(8, { message: "8+ characters required" }).trim(), })
export const zr_colorsize_reset_pwd_FormScheme = z .object({ oldPwd: z.string().min(8, { message: "8+ characters required" }).trim(), newPwd: z.string().min(8, { message: "1+ characters required" }).trim(), confirmPwd: z .string() .min(8, { message: "4+ characters required" }) .trim() })
The above code how to verify whether newPwd and confirmPwd are consistent, and can get a custom message when the verification fails, just like two passwords are inconsistent; Just like if this check doesn't pass, it gets it in errors.message.min(8, { message: "4+ characters required" })