From 786ba6c28c1b9bc6c583c9cbc5a2fc579915369e Mon Sep 17 00:00:00 2001 From: Jean-Daniel Lamontagne Date: Sun, 13 Nov 2022 16:56:38 -0500 Subject: [PATCH] error message show invalide commande --- .../grosses-mitaines-ui/src/pages/ReviewInvoice.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/GrossesMitaines/grosses-mitaines-ui/src/pages/ReviewInvoice.js b/GrossesMitaines/grosses-mitaines-ui/src/pages/ReviewInvoice.js index b584840..3ed6c12 100644 --- a/GrossesMitaines/grosses-mitaines-ui/src/pages/ReviewInvoice.js +++ b/GrossesMitaines/grosses-mitaines-ui/src/pages/ReviewInvoice.js @@ -132,7 +132,6 @@ const ReviewInvoice = () => { body: json }) console.log(json); - if (response.ok) { mySwal.fire({ title: 'Commande envoyée avec succès!', @@ -140,10 +139,17 @@ const ReviewInvoice = () => { icon: "success" }) cart.items = []; - navigate('./myinvoices'); + navigate('./Morceaux'); } - else + else { console.log("Erreur de creation la commande #" + thisInvoice.id); + mySwal.fire({ + title: 'Erreur!', + timer: 2000, + icon: "error" + }) + } + } return (