fetch gfix
This commit is contained in:
@@ -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());
|
||||
|
||||
Reference in New Issue
Block a user