fixes for new config editor

This commit is contained in:
2026-02-19 11:51:49 +01:00
parent f1f2a14ccd
commit 4340a58450
3 changed files with 58 additions and 46 deletions
+6 -2
View File
@@ -212,7 +212,9 @@
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(data)
});
const json = await res.json();
const text = await res.text();
let json;
try { json = JSON.parse(text); } catch (_) { throw new Error('Serverantwort ist kein JSON:\n'+text); }
if (!json.success) throw new Error(json.message || 'Fehler');
alert('Konfiguration angelegt: ' + json.filename);
location.reload();
@@ -233,7 +235,9 @@
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(data)
});
const json = await res.json();
const text = await res.text();
let json;
try { json = JSON.parse(text); } catch (_) { throw new Error('Serverantwort ist kein JSON:\n'+text); }
if (!json.success) throw new Error(json.message || 'Fehler');
alert('Theme angelegt: ' + json.path);
location.reload();