diff --git a/script.js b/script.js index a67bbe8..c36b947 100644 --- a/script.js +++ b/script.js @@ -33,7 +33,7 @@ function listPizze(){ ${pizza.nome} ${pizza.prezzo}€ - + `; }); @@ -54,7 +54,7 @@ function deletePizza(id){ redirect: "follow" }; - fetch("http://localhost:5011/api/pizze/1", requestOptions) + fetch(apiUrl + "/api/pizze/" + id, requestOptions) .then((response) => response.text()) .then((result) => alert("Pizza eliminata con successo!")) .catch((error) => {