feat(SW-160): update profile

This commit is contained in:
Simon Emanuelsson
2024-07-17 16:12:18 +02:00
committed by Michael Zetterberg
parent b6e22d51a5
commit 2337d37f1a
32 changed files with 459 additions and 244 deletions

View File

@@ -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"],
})
}
}