unrip/src/operator-dashboard/static/lib/api.js
philipp 903287ec21
All checks were successful
deploy / deploy (push) Successful in 1m5s
Ship full operator dashboard frontend
Proof: Include the full operator-dashboard frontend source tree so the deployment image can build and serve the dashboard UI that consumes runtime health severity.

Assumptions: The current static dashboard source tree in the worktree is the intended frontend for this turn and belongs with the deployed operator-dashboard backend.

Still fake: External alert receiver remains unconfigured; this commit only resolves the dashboard asset source gap in the deploy.
2026-04-08 19:41:43 +02:00

11 lines
292 B
JavaScript

export async function fetchJson(url, options = {}) {
const response = await fetch(url, options);
const text = await response.text();
const data = text ? JSON.parse(text) : null;
if (!response.ok) {
throw new Error(data?.error || `HTTP ${response.status}`);
}
return data;
}