Changed error handling
This commit is contained in:
parent
c180b3c302
commit
f4186840fb
1 changed files with 3 additions and 3 deletions
|
|
@ -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] });
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue