fix: handle profile update when dateOfBirth is missing
This commit is contained in:
@@ -120,6 +120,15 @@ export const editProfile = protectedServerActionProcedure
|
||||
return
|
||||
}
|
||||
|
||||
// Handle case where dateOfBirth is missing in profile and not updated in form
|
||||
if (
|
||||
typedKey === "dateOfBirth" &&
|
||||
!profile.dateOfBirth &&
|
||||
payload.data.dateOfBirth === "1900-01-01"
|
||||
) {
|
||||
return
|
||||
}
|
||||
|
||||
if (payload.data[typedKey] !== profile[typedKey]) {
|
||||
// @ts-ignore
|
||||
body[typedKey] = payload.data[typedKey]
|
||||
|
||||
Reference in New Issue
Block a user