From 08e5ba6298fbcc721287a146d23ea6421c1be900 Mon Sep 17 00:00:00 2001 From: ZGaetano Date: Mon, 18 May 2026 23:48:56 -0400 Subject: [PATCH] =?UTF-8?q?fix(jobs):=20fetchJobs=20=E2=86=92=20loadJobs,?= =?UTF-8?q?=20add=20credentials=20to=20inline=20api=20helper?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit killJob() referenced fetchJobs() which is undefined — the correct name is loadJobs(). Also the inline api() wrapper was missing credentials:'include' so any API call on the jobs page would fail with a 401 in prod. --- services/web-ui/public/jobs.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/services/web-ui/public/jobs.html b/services/web-ui/public/jobs.html index aa1fbb0..4b61829 100644 --- a/services/web-ui/public/jobs.html +++ b/services/web-ui/public/jobs.html @@ -535,6 +535,7 @@ let activeCount = 0; ──────────────────────────────────────────────────────── */ async function api(path, opts = {}) { const r = await fetch(API + path, { + credentials: 'include', headers: { 'Content-Type': 'application/json' }, ...opts }); @@ -700,7 +701,7 @@ async function killJob(jobId, ev) { if (!confirm('Remove this job from the queue? If a worker is still processing it, the run is abandoned.')) return; try { const r = await fetch('/api/v1/jobs/' + encodeURIComponent(jobId), { method: 'DELETE', credentials: 'include' }); - if (r.ok) { toast('Job removed', 'success'); fetchJobs(); } + if (r.ok) { toast('Job removed', 'success'); loadJobs(); } else { const d = await r.json().catch(()=>({})); toast('Remove failed: ' + (d.error || r.statusText), 'error'); } } catch (err) { toast('Remove failed: ' + err.message, 'error');