diff options
author | Lia Lenckowski <lialenck@protonmail.com> | 2023-08-23 17:53:59 +0200 |
---|---|---|
committer | Lia Lenckowski <lialenck@protonmail.com> | 2023-08-23 17:53:59 +0200 |
commit | c85a846fcee843ae830d1acd0833ddf95fbb3d7e (patch) | |
tree | d0021a425f0094251cf48f501d1312f74946fe0c /frontend/admin.ts | |
parent | 49f8a190a5de848a834e82749799295fe9a4bc50 (diff) | |
download | fastbangs-c85a846fcee843ae830d1acd0833ddf95fbb3d7e.tar fastbangs-c85a846fcee843ae830d1acd0833ddf95fbb3d7e.tar.bz2 fastbangs-c85a846fcee843ae830d1acd0833ddf95fbb3d7e.tar.zst |
make all urls relative
now works with url-rewriting reverse proxies, when BASE_URL is set correctly
Diffstat (limited to 'frontend/admin.ts')
-rw-r--r-- | frontend/admin.ts | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/frontend/admin.ts b/frontend/admin.ts index 1b6ba90..40a7a94 100644 --- a/frontend/admin.ts +++ b/frontend/admin.ts @@ -10,7 +10,7 @@ interface PendingBang { async function sendVerdict(user: string, pw: string, b: PendingBang, accept: boolean, info_block: HTMLDivElement) { - let err = await fetch(accept? "/acceptBang" : "/rejectBang", { + let err = await fetch(accept? "acceptBang" : "rejectBang", { headers: { Accept: "application/json", "Content-Type": "application/json", @@ -26,12 +26,12 @@ async function sendVerdict(user: string, pw: string, b: PendingBang, else info_block.remove() // TODO in the accept case, we should try invalidating the browser cache - // for /bangs.json. My idea is to make a HEAD request to let the browser + // for ./bangs.json. My idea is to make a HEAD request to let the browser // see that the etag has changed; idk of that works } export async function tryLoadAdminPanel(user: string, pw: string) { - const r = await fetch("/pendingBangs", { + const r = await fetch("pendingBangs", { headers: { Accept: "application/json", Authorization: "Basic " + btoa(`${user}:${pw}`), |