Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 511823f

Browse files
Small fix
1 parent 53b703d commit 511823f

File tree

2 files changed

+16
-13
lines changed

2 files changed

+16
-13
lines changed

‎.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
.DS_Store
22
node_modules
33
.netlify
4+
.env

‎public/index.html

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -54,19 +54,21 @@ <h2>Result:</h2>
5454
let user = await netlifyIdentity.currentUser();
5555

5656
const response = await fetch("/.netlify/functions/save", {
57-
headers: {
58-
Authorization: `Bearer ${token}`,
59-
},
60-
method: "post",
61-
body: JSON.stringify({
62-
data: data,
63-
type: type,
64-
}),
65-
}).then(function(res) {
66-
document.querySelector(
67-
"#result"
68-
).innerHTML = `Succesfully uploaded <b>${type}</b>!`;
69-
});
57+
headers: {
58+
Authorization: `Bearer ${token}`,
59+
},
60+
method: "post",
61+
body: JSON.stringify({
62+
data: data,
63+
type: type,
64+
}),
65+
})
66+
.then((response) => response.json())
67+
.then(function(res) {
68+
document.querySelector(
69+
"#result"
70+
).innerHTML = `Result: <b>${res.body}</b>`;
71+
});
7072
}
7173

7274
document.getElementById("select").onchange = function(evt) {

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /