fixes for new config editor
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user