Tuer des bébés

This commit is contained in:
Victor Turgeon
2022-10-18 10:08:23 -04:00
parent 84e6bb9bc3
commit e5377fb35b
5 changed files with 21 additions and 3 deletions

View File

@@ -30,9 +30,13 @@ const Inventaire = () => {
};
const handleDeleteItem = async (id) => {
const res = await axios.delete(`${INVENTAIRE_URL}/${id}`)
setMorceaux(morceaux.filter((morceau) => morceau.id !== id))
const response = await fetch(`https://localhost:7292/Product?id=${id}`, { method: 'DELETE', mode: 'cors' });
// const res = await axios.delete(`${INVENTAIRE_URL}/${id}`)
if (response.ok)
setMorceaux(morceaux.filter((morceau) => morceau.id !== id))
else
console.log("Erreur leur du DELETE de " + id);
};
const handleModifyItem = async (id) => {