Skip to content

Commit

Permalink
fix(AccountSettings): allow user to clear their location (#10508)
Browse files Browse the repository at this point in the history
fix: allow user to clear their location
  • Loading branch information
araujobarret committed Jul 23, 2024
1 parent 9b289af commit 7f42782
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/app/Scenes/MyAccount/updateMyUserProfile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export const updateMyUserProfile = async (
updateMyUserProfile(input: $input) {
me {
...MyProfileHeader_me
...MyProfileEditForm_me
email
name
phone
Expand Down
9 changes: 9 additions & 0 deletions src/app/Scenes/MyProfile/Components/UserProfileFields.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,15 @@ export const UserProfileFields: React.FC<UserProfileFieldsProps> = ({ bottomShee
coordinates,
})
}}
onClear={() =>
setFieldValue("location", {
city: "",
country: "",
postalCode: "",
state: "",
stateCode: "",
})
}
bottomSheetInput={bottomSheetInput}
/>
</Flex>
Expand Down
2 changes: 1 addition & 1 deletion src/app/Scenes/MyProfile/MyProfileEditForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ export const MyProfileEditForm: React.FC<MyProfileEditFormProps> = ({ onSuccess
delete updatedLocation.display
const payload = {
name,
...(location ? { location: updatedLocation } : {}),
location: updatedLocation,
profession,
otherRelevantPositions,
}
Expand Down

0 comments on commit 7f42782

Please sign in to comment.