From f89bc8664203d9e40e33426dcee08c2bfac5ff3a Mon Sep 17 00:00:00 2001 From: AndreStork Date: Mon, 10 Nov 2025 12:19:38 +0100 Subject: [PATCH] Fix list not reloading after deleting entry --- script.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/script.js b/script.js index c36b947..3228057 100644 --- a/script.js +++ b/script.js @@ -56,11 +56,12 @@ function deletePizza(id){ fetch(apiUrl + "/api/pizze/" + id, requestOptions) .then((response) => response.text()) - .then((result) => alert("Pizza eliminata con successo!")) + .then((result) => { + alert("Pizza eliminata con successo!"); + listPizze(); + }) .catch((error) => { console.error(error) alert("Errore nell'eliminazione della pizza, controllare la console per dettagli sull'errore."); }); - - listPizze(); } \ No newline at end of file