Les dejo la funcion handleDelete
const handleDelete = (id) => {
deleteProduct(id)
.then(() => {
setAlert({
active: true,
message: "Product Deleted",
type: "success",
autoClose: false,
});
})
.catch((error) => {
setAlert({
active: true,
message: error.message,
type: "error",
autoClose: false,
});
});
};
Los aportes, preguntas y respuestas son vitales para aprender en comunidad. Reg铆strate o inicia sesi贸n para participar.