feat(SW-160): update profile
This commit is contained in:
committed by
Michael Zetterberg
parent
b6e22d51a5
commit
2337d37f1a
@@ -25,12 +25,12 @@ export const editProfileSchema = z
|
||||
"Please enter a valid phone number"
|
||||
),
|
||||
|
||||
currentPassword: z.string().optional(),
|
||||
password: z.string().optional(),
|
||||
newPassword: z.string().optional(),
|
||||
retypeNewPassword: z.string().optional(),
|
||||
})
|
||||
.superRefine((data, ctx) => {
|
||||
if (data.currentPassword) {
|
||||
if (data.password) {
|
||||
if (!data.newPassword) {
|
||||
ctx.addIssue({
|
||||
code: "custom",
|
||||
@@ -50,7 +50,7 @@ export const editProfileSchema = z
|
||||
ctx.addIssue({
|
||||
code: "custom",
|
||||
message: "Current password is required",
|
||||
path: ["currentPassword"],
|
||||
path: ["password"],
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user