Skip to content

Commit a186231

Browse files
committed
Implement email change request
v0.3.1
1 parent cfe5755 commit a186231

2 files changed

Lines changed: 10 additions & 2 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "borum-sphere",
3-
"version": "0.3.0",
3+
"version": "0.3.1",
44
"description": "The web app for Borum users to read, update, delete, and create their account and the Borum products that they're using",
55
"private": true,
66
"dependencies": {

src/InlineFormElements/Email/email.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,16 @@ export default function Email(props) {
88
const onEmailSaveClick = e => {
99
fetch("https://api.bforborum.com/api/login", {
1010
method: "PUT",
11+
headers: {
12+
"content-type": "application/x-www-form-urlencoded",
13+
"authorization": "Basic " + sessionStorage.getItem("apiKey")
14+
},
1115
body: `email=${email}`,
12-
});
16+
}).then(response => response.json()).then(response => {
17+
if (!response.ok) {
18+
alert("A system error occurred and the email could not be changed. We apologize for the inconvenience.");
19+
}
20+
})
1321
};
1422

1523
return (

0 commit comments

Comments
 (0)