Skip to content
This repository was archived by the owner on Apr 5, 2024. It is now read-only.

Commit bb1f588

Browse files
committed
Fixed Undefined error when profile is changed and backand says no
1 parent a388541 commit bb1f588

File tree

2 files changed

+3
-25
lines changed

2 files changed

+3
-25
lines changed

src/background/api/userInformation.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@ export const changeUserInformation = (userWithNewInformation: UserInformation):
2424
resolve(response.data)
2525
})
2626
.catch((error) => {
27-
console.log("[userInformation.ts] " + error);
28-
reject(error);
27+
reject(error.response?.data?.message);
2928
});
3029
})
3130
};

src/components/pages/User/Profile.tsx

Lines changed: 2 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -66,32 +66,11 @@ export default function Profile(): ReactElement {
6666
handleAlertVisibility(DEFAULT_ALERT_DURATION, "success", "Worked: " + (res));
6767
})
6868
.catch(err => {
69-
handleAlertVisibility(DEFAULT_ALERT_DURATION, "danger", "Error: " + (err.outputMessage ? err.outputMessage : (err.httpStatus + " " + err.httpMessage)))
69+
console.log("Error:" + err)
70+
handleAlertVisibility(DEFAULT_ALERT_DURATION, "danger", "Error: " + err)
7071
})
7172
}
7273

73-
/*function EditProfile(): ReactElement {
74-
return (
75-
<Form>
76-
<Form.Group controlId="editProfileForm-Username">
77-
<Form.Label>Your Username</Form.Label>
78-
<Form.Control type="text" placeholder="Enter username" defaultValue={user.username ?? ""}/>
79-
<Form.Text>
80-
Your username will be visible to anyone using this system.
81-
</Form.Text>
82-
</Form.Group>
83-
<Form.Group controlId="editProfileForm.Password">
84-
<Form.Label>New Password</Form.Label>
85-
<Form.Control type="password" placeholder="New Password"/>
86-
</Form.Group>
87-
<Form.Group controlId="editProfileForm.PasswordConfirmation">
88-
<Form.Label>Repeat new Password</Form.Label>
89-
<Form.Control type="password" placeholder="New Password"/>
90-
</Form.Group>
91-
</Form>
92-
)
93-
}*/
94-
9574
function EditProfile(): ReactElement {
9675
return (
9776
<>

0 commit comments

Comments
 (0)