This commit is contained in:
DavidBelisle
2022-11-23 16:56:52 -05:00
parent 67016e388f
commit 8a887f7d7e
2 changed files with 18 additions and 30 deletions

View File

@@ -9,10 +9,6 @@ const MyInvoices = () => {
const [invoices, setInvoices] = useState([]);
const mySwal = withReactContent(Swal);
const [alertTitle, setAlertTitle] = useState("");
const [alertMessage, setAlertMessage] = useState("");
const [showAlert, setShowAlert] = useState(false);
useEffect(() => {
fetch(`https://localhost:7292/api/Invoice`, {
@@ -50,7 +46,6 @@ const MyInvoices = () => {
const deletedId = await response.json();
setInvoices(invoices.filter((invoice) => invoice.id !== deletedId));
onShowAlert('Suppression de la commande avec succès!', 2000);
mySwal.fire({
title: `Commande annulée...`,
text: `La commande a été annulée!`,
@@ -70,15 +65,6 @@ const MyInvoices = () => {
};
const onShowAlert = (title, message, time) => {
setAlertTitle(title);
setAlertMessage(message);
setShowAlert(true);
window.setTimeout(() => { setShowAlert(false); }, time);
}
return (