Spaces:
Runtime error
Runtime error
File size: 415 Bytes
32c8469 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
function delete_item(elem){
result = confirm("Do you really wanna delete this ?");
if(result==false) return;
data = {"id":elem.dataset.id};
fetch(deleteItem,{
method:"POST",
headers:{
"content-type":"application/json",
"X-CSRF-TOKEN":csrf_token,
},
body:JSON.stringify(data)
}).then(res=>res).then((res)=>{
elem.remove();
});
} |