Skip to content

Commit

Permalink
Merge pull request #150 from CS3219-AY2324S1/update-profile
Browse files Browse the repository at this point in the history
Remove console log, add toast for profile update
  • Loading branch information
carriezhengjr authored Nov 14, 2023
2 parents 60428db + a721617 commit dd5372c
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions frontend/src/pages/users/EditProfile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,17 +74,21 @@ const EditProfile: React.FC<EditProfileProps> = ({
languages,
};

console.log('Request Data:', updatedProfile);

const response = new AuthAPI()
new AuthAPI()
.updateUserProfile(updatedProfile)
.then((user) => {
console.log('Response Data:', response);

dispatch(setUser(user));

// Close the modal.
onCloseModal();

toast({
title: 'Profile Updated!',
description: 'Your profile has been successfully updated!',
status: 'success',
duration: 4000,
isClosable: true,
});
})
.catch((err: AxiosError<{ errors: Array<{ msg: string }> }>) => {
console.error('Error updating profile:', err);
Expand Down

0 comments on commit dd5372c

Please sign in to comment.