fix: update visionData cache immediately before network save
Prevents stale reads when renderMoodboard runs after saveVisionSection Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
+3
-4
@@ -1013,13 +1013,12 @@ function showSaved() {
|
|||||||
async function saveVisionSection(section, contenu) {
|
async function saveVisionSection(section, contenu) {
|
||||||
const row = visionData[section];
|
const row = visionData[section];
|
||||||
if (!row) return;
|
if (!row) return;
|
||||||
await fetch(`/api/vision/${row.Id}`, {
|
row.Contenu = contenu; // update local cache immediately
|
||||||
|
fetch(`/api/vision/${row.Id}`, {
|
||||||
method: 'PATCH',
|
method: 'PATCH',
|
||||||
headers: { 'Content-Type': 'application/json' },
|
headers: { 'Content-Type': 'application/json' },
|
||||||
body: JSON.stringify({ Contenu: contenu }),
|
body: JSON.stringify({ Contenu: contenu }),
|
||||||
});
|
}).then(() => showSaved());
|
||||||
row.Contenu = contenu;
|
|
||||||
showSaved();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function setupEditable(elId, section) {
|
function setupEditable(elId, section) {
|
||||||
|
|||||||
Reference in New Issue
Block a user