fix(#1995): send {} body on schedule cancel-all (was empty body 400)

This commit is contained in:
damocles 2026-06-26 00:35:52 +02:00 committed by mara
commit 09dc3682d7

View file

@ -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(() => '');