fetch gfix

This commit is contained in:
2026-05-07 13:29:49 +03:00
parent fcadc8d7a1
commit 8cf1dd9bfd
5 changed files with 39 additions and 43 deletions
+2
View File
@@ -65,6 +65,7 @@ export function apiPost(url, body, options = {}) {
body: JSON.stringify(body),
headers: {
"Content-Type": "application/json",
"X-Requested-With": "XMLHttpRequest",
"X-CSRF-TOKEN": document.querySelector('meta[name="csrf-token"]').content,
...options.headers,
},
@@ -77,6 +78,7 @@ export function apiGet(url, options = {}) {
method: "GET",
headers: {
"X-CSRF-TOKEN": document.querySelector('meta[name="csrf-token"]').content,
"X-Requested-With": "XMLHttpRequest",
...options.headers,
},
}).then((r) => r.json());