From 4af3660653e189f376c7cdf1795a9422d3b796d4 Mon Sep 17 00:00:00 2001 From: Davide Scaini Date: Thu, 7 May 2026 12:15:19 +0200 Subject: [PATCH] Trigger rebuild after save and show building status --- src/components/PageEditor.svelte | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/components/PageEditor.svelte b/src/components/PageEditor.svelte index b6e2983..cd81f9f 100644 --- a/src/components/PageEditor.svelte +++ b/src/components/PageEditor.svelte @@ -82,7 +82,10 @@ body: JSON.stringify({ content }), }); if (!r.ok) throw new Error(await r.text()); - saveStatus = 'Salvato'; + saveStatus = 'Costruendo…'; + const rb = await fetch('/rebuild', { method: 'POST', credentials: 'include' }); + if (!rb.ok) throw new Error(`Rebuild fallito: ${await rb.text()}`); + saveStatus = 'Pubblicato'; if (isNew) { savedUrl = apiBase === '/stories' ? `/blog/${s}/` : `/entries/${s}/`; } else {