aboutsummaryrefslogtreecommitdiffstats
path: root/spring-front/src/components/Editor.js
diff options
context:
space:
mode:
authorterminaldweller <thabogre@gmail.com>2022-06-09 15:39:43 +0000
committerterminaldweller <thabogre@gmail.com>2022-06-09 15:39:43 +0000
commit2f7516a0af0eaca205b71415a0910084cb452d33 (patch)
tree1c56cdbf77e826d142e5b2ea8ccf03273054de4f /spring-front/src/components/Editor.js
parentserver link (diff)
downloadmdrtl-2f7516a0af0eaca205b71415a0910084cb452d33.tar.gz
mdrtl-2f7516a0af0eaca205b71415a0910084cb452d33.zip
wip
Diffstat (limited to 'spring-front/src/components/Editor.js')
-rw-r--r--spring-front/src/components/Editor.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/spring-front/src/components/Editor.js b/spring-front/src/components/Editor.js
index b77be1e..108d87d 100644
--- a/spring-front/src/components/Editor.js
+++ b/spring-front/src/components/Editor.js
@@ -134,7 +134,7 @@ export default class Editor extends React.Component {
// DELETE
handleDelete() {
- fetch(mdrtlConfig.serverURL + this.docId, {
+ fetch(`${mdrtlConfig.serverURL}/${this.docId}`, {
method: "DELETE",
headers: {
Accept: "application/json",
@@ -149,7 +149,7 @@ export default class Editor extends React.Component {
// GET
handleLoad(event) {
let res;
- fetch(mdrtlConfig.serverURL + this.docId).then((response) => {
+ fetch(`${mdrtlConfig.serverURL}/${this.docId}`).then((response) => {
if (!response.ok) {
throw new Error(`request failed with status ${response.status}`);
}
@@ -173,7 +173,7 @@ export default class Editor extends React.Component {
lastModified: Math.floor(Date.now() / 1000),
body: this.state.value,
};
- let response = await fetch(mdrtlConfig.serverURL + this.docId, {
+ let response = await fetch(`${mdrtlConfig.serverURL}/${this.docId}`, {
method: "POST",
body: JSON.stringify(obj),
mode: "cors",
@@ -190,7 +190,7 @@ export default class Editor extends React.Component {
lastModified: Math.floor(Date.now() / 1000),
body: this.state.value,
};
- let response = await fetch(mdrtlConfig.serverURL + this.docId, {
+ let response = await fetch(`${mdrtlConfig.serverURL}/${this.docId}`, {
method: "PUT",
body: JSON.stringify(obj),
mode: "cors",