(updates)
| 1 | import { state } from "./config.js"; |
| 2 | |
| 3 | export async function saveConfigData(updates) { |
| 4 | const res = await fetch(state.API_BASE + "/api/config/update", { |
| 5 | method: "POST", |
| 6 | headers: { "Content-Type": "application/json" }, |
| 7 | body: JSON.stringify(updates), |
| 8 | }); |
| 9 | if (!res.ok) { |
| 10 | throw new Error("Save Config Failed"); |
| 11 | } |
| 12 | return await res.json(); |
| 13 | } |
| 14 | |
| 15 | export async function restartRuntime() { |
| 16 | const res = await fetch(state.API_BASE + "/api/runtime/restart", { |
no outgoing calls
no test coverage detected