MCPcopy Index your code
hub / github.com/stemdeckapp/stemdeck / _save

Function _save

static/js/sections.js:350–371  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

348}
349
350async 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

Callers 1

destroySectionsFunction · 0.70

Calls 2

_hideSaveIndicatorFunction · 0.85
_showSavedFunction · 0.85

Tested by

no test coverage detected