Add content-type to sent requests

This commit is contained in:
Yukino Song
2025-05-28 14:09:12 +08:00
parent b2ec048333
commit f3d2078b11
7 changed files with 53 additions and 20 deletions

View File

@@ -599,7 +599,10 @@
fetch("./api/apps/reorder", {
credentials: 'include',
method: "POST",
headers: {
'Content-Type': 'application/json'
},
method: 'POST',
body: JSON.stringify({order: reorderedUUIDs})
})
.then(r => r.json())
@@ -636,7 +639,7 @@
this.actionDisabled = true;
fetch("./api/apps/launch?uuid=" + app.uuid, {
credentials: 'include',
method: "POST",
method: 'POST',
})
.then(r => r.json())
.then(r => {
@@ -655,7 +658,7 @@
this.actionDisabled = true;
fetch("./api/apps/close", {
credentials: 'include',
method: "POST"
method: 'POST',
})
.then((r) => r.json())
.then((r) => {
@@ -681,7 +684,7 @@
this.actionDisabled = true;
fetch("./api/apps/delete?uuid=" + app.uuid, {
credentials: 'include',
method: "POST"
method: 'POST'
}).then((r) => r.json())
.then((r) => {
if (!r.status) {
@@ -789,7 +792,10 @@
this.coverFinderBusy = true;
fetch("./api/covers/upload", {
credentials: 'include',
method: "POST",
headers: {
'Content-Type': 'application/json'
},
method: 'POST',
body: JSON.stringify({
key: cover.key,
url: cover.saveUrl,
@@ -814,7 +820,10 @@
delete this.editForm.dragover;
fetch("./api/apps", {
credentials: 'include',
method: "POST",
headers: {
'Content-Type': 'application/json'
},
method: 'POST',
body: JSON.stringify(this.editForm),
}).then((r) => r.json())
.then((r) => {