Fixed delete button issues
This commit is contained in:
@@ -33,7 +33,7 @@ function listPizze(){
|
||||
<td>${pizza.nome}</td>
|
||||
<td>${pizza.prezzo}€</td>
|
||||
<td><button onclick="alert('WIP')">Modifica</button>
|
||||
<button onclick="deletePizza({pizza.id})">X</button></td>
|
||||
<button onclick="deletePizza(${pizza.id})">X</button></td>
|
||||
</tr>`;
|
||||
});
|
||||
|
||||
@@ -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) => {
|
||||
|
||||
Reference in New Issue
Block a user