Skip to content

Commit

Permalink
Fix type error in updateProfile function
Browse files Browse the repository at this point in the history
  • Loading branch information
christie26 committed Dec 16, 2023
1 parent 1b44a2f commit 7e8bfec
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions project/frontend/src/components/profile/ProfileEditModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,12 @@ export const ProfileEditModal: React.FC<ModalProfileProps> = ({
fetchData();
onClose();
} catch (error) {
alert(`${error.error.message}`);
console.error('Error saving changes:', error);
if (error instanceof Error) {
alert(`${error.message}`);
console.error('Error saving changes:', error);
} else {
console.error('Non-Error type error:', error);
}
}
}, [api, newData, onClose, fetchData]);

Expand Down

0 comments on commit 7e8bfec

Please sign in to comment.