()
| 348 | } |
| 349 | |
| 350 | async function _save() { |
| 351 | if (!_trackId) return; |
| 352 | const id = _trackId; |
| 353 | const body = JSON.stringify({ sections: _sections }); |
| 354 | try { |
| 355 | const res = await fetch(`/api/jobs/${id}/sections`, { |
| 356 | method: "PATCH", |
| 357 | headers: { "Content-Type": "application/json" }, |
| 358 | body, |
| 359 | }); |
| 360 | if (!res.ok) { |
| 361 | const detail = await res.text().catch(() => String(res.status)); |
| 362 | console.warn("[sections] save failed:", res.status, detail); |
| 363 | if (id === _trackId) _hideSaveIndicator(); |
| 364 | return; |
| 365 | } |
| 366 | if (id === _trackId) _showSaved(); |
| 367 | } catch (e) { |
| 368 | console.warn("[sections] save failed:", e); |
| 369 | if (id === _trackId) _hideSaveIndicator(); |
| 370 | } |
| 371 | } |
| 372 | |
| 373 | // ─── Utilities ──────────────────────────────────────────── |
| 374 |
no test coverage detected