diff --git a/frontend/packages/dashboard/src/schedules.js b/frontend/packages/dashboard/src/schedules.js index 410567c0..0b196a0d 100644 --- a/frontend/packages/dashboard/src/schedules.js +++ b/frontend/packages/dashboard/src/schedules.js @@ -1072,8 +1072,11 @@ async function postScheduleCancel(id, targets) { const opts = { method: 'POST', headers: { 'Content-Type': 'application/json' }, + // Always send a valid JSON body — cancel-all is `{}` (an empty body + // with a json content-type would 400 a strict extractor). Per-target + // cancel carries the list. + body: JSON.stringify(targets ? { targets } : {}), }; - if (targets) opts.body = JSON.stringify({ targets }); const resp = await fetch('/api/schedules/' + encodeURIComponent(id) + '/cancel', opts); if (!resp.ok) { const text = await resp.text().catch(() => '');