diff --git a/src/frontend/src/pages/ProfileSettingsPage/index.tsx b/src/frontend/src/pages/ProfileSettingsPage/index.tsx index 3f89dfa7f..fc12d2fb3 100644 --- a/src/frontend/src/pages/ProfileSettingsPage/index.tsx +++ b/src/frontend/src/pages/ProfileSettingsPage/index.tsx @@ -40,8 +40,8 @@ export default function ProfileSettingsPage(): JSX.Element { return; } try { - await resetPassword(userData!.id, { password }); - await updateUser(userData!.id, { profile_image: gradient }); + if(password !== "") await resetPassword(userData!.id, { password }); + if(gradient !== "") await updateUser(userData!.id, { profile_image: gradient }); if (gradient !== "") { let newUserData = cloneDeep(userData); newUserData!.profile_image = gradient; @@ -50,7 +50,7 @@ export default function ProfileSettingsPage(): JSX.Element { } setSuccessData({ title: "Changes saved successfully!" }); } catch (error) { - setErrorData({ title: "Error saving changes", list: [error as string] }); + setErrorData({ title: "Error saving changes", list: [(error as any).response.data.detail] }); } }