Fix caching

This commit is contained in:
oliver
2026-04-15 18:47:48 -03:00
parent 1693e003c8
commit 5c5015883d
+3 -1
View File
@@ -442,13 +442,15 @@
async function apiFetch(method, body) { async function apiFetch(method, body) {
const opts = { const opts = {
method, method,
cache: "no-store",
headers: { headers: {
"Content-Type": "application/json", "Content-Type": "application/json",
...authHeaders(), ...authHeaders(),
}, },
}; };
if (body !== undefined) opts.body = JSON.stringify(body); 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) if (res.status === 401 || res.status === 403)
throw new Error("AUTH"); throw new Error("AUTH");
if (!res.ok) throw new Error("HTTP " + res.status); if (!res.ok) throw new Error("HTTP " + res.status);