Fix caching
This commit is contained in:
@@ -442,13 +442,15 @@
|
||||
async function apiFetch(method, body) {
|
||||
const opts = {
|
||||
method,
|
||||
cache: "no-store",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
...authHeaders(),
|
||||
},
|
||||
};
|
||||
if (body !== undefined) opts.body = JSON.stringify(body);
|
||||
const res = await fetch(API, opts);
|
||||
const url = method === "GET" ? API + "?_t=" + Date.now() : API;
|
||||
const res = await fetch(url, opts);
|
||||
if (res.status === 401 || res.status === 403)
|
||||
throw new Error("AUTH");
|
||||
if (!res.ok) throw new Error("HTTP " + res.status);
|
||||
|
||||
Reference in New Issue
Block a user