restore frontend base structure

This commit is contained in:
ecki
2026-03-10 12:10:43 +01:00
parent a49a034da1
commit 9a7881ffa0
4 changed files with 114 additions and 1019 deletions
+22
View File
@@ -0,0 +1,22 @@
const API = "/resman/api";
async function api(url, options = {}) {
const res = await fetch(url, options);
if (!res.ok) {
let msg = "API error";
try {
const err = await res.json();
msg = err.error || msg;
} catch(e){}
alert("Fehler: " + msg);
throw new Error(msg);
}
return res.json();
}