diff --git a/public/index.html b/public/index.html index 3110f45..5a0ecbb 100644 --- a/public/index.html +++ b/public/index.html @@ -1013,13 +1013,12 @@ function showSaved() { async function saveVisionSection(section, contenu) { const row = visionData[section]; if (!row) return; - await fetch(`/api/vision/${row.Id}`, { + row.Contenu = contenu; // update local cache immediately + fetch(`/api/vision/${row.Id}`, { method: 'PATCH', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ Contenu: contenu }), - }); - row.Contenu = contenu; - showSaved(); + }).then(() => showSaved()); } function setupEditable(elId, section) {