gossage
This commit is contained in:
@@ -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 (
|
||||
|
||||
Reference in New Issue
Block a user