adads
This commit is contained in:
@@ -173,9 +173,16 @@
|
||||
}
|
||||
|
||||
// 1. Daten extrahieren
|
||||
const htmlContent = editor.getHtml() + '<style>' + editor.getCss() + '</style>';
|
||||
// 2. KRITISCH: Holt die JSON-Repräsentation des Editors
|
||||
const jsonProjectData = editor.getProjectData();
|
||||
const htmlContent = editor.getHtml() + '<style>' + editor.getCss() + '</style>';
|
||||
// 2. KRITISCH: Holt die JSON-Repräsentation des Editors
|
||||
let jsonProjectDataRaw = '';
|
||||
try {
|
||||
const jsonProjectData = editor.getProjectData();
|
||||
jsonProjectDataRaw = JSON.stringify(jsonProjectData);
|
||||
} catch (e) {
|
||||
console.error('[bridge-blocks-api] getProjectData stringify failed', e);
|
||||
jsonProjectDataRaw = '';
|
||||
}
|
||||
|
||||
const resource = EDITOR_MODE;
|
||||
const action = `${resource}.update`;
|
||||
@@ -183,13 +190,13 @@
|
||||
log('SAVE START', 'Starte Speichern des Inhalts an die API...', '#FF4500');
|
||||
|
||||
// 3. Daten für den POST-Request vorbereiten
|
||||
const dataToSend = {
|
||||
action,
|
||||
id: CURRENT_ENTITY_ID,
|
||||
html: htmlContent,
|
||||
// 🚨 KRITISCH: Server erwartet das Feld 'json'
|
||||
json: jsonProjectData,
|
||||
};
|
||||
const dataToSend = {
|
||||
action,
|
||||
id: CURRENT_ENTITY_ID,
|
||||
html: htmlContent,
|
||||
// 🚨 KRITISCH: Server erwartet das Feld 'json'
|
||||
json: jsonProjectDataRaw,
|
||||
};
|
||||
|
||||
if (B.CURRENT_ENTITY_NAME) {
|
||||
dataToSend.name = B.CURRENT_ENTITY_NAME;
|
||||
|
||||
Reference in New Issue
Block a user