From 6120bf544aae0ee97a64036f77b5fc1887e17b14 Mon Sep 17 00:00:00 2001 From: Victor Turgeon <76506447+Medenos@users.noreply.github.com> Date: Tue, 22 Nov 2022 12:13:19 -0500 Subject: [PATCH] =?UTF-8?q?Retir=C3=A9=20des=20console.log()=20unsafes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../grosses-mitaines-ui/src/pages/Inventaire.js | 7 ------- GrossesMitaines/grosses-mitaines-ui/src/pages/Invoices.js | 3 --- .../grosses-mitaines-ui/src/pages/MyAddresses.js | 5 ----- .../grosses-mitaines-ui/src/pages/MyInvoices.js | 3 --- .../grosses-mitaines-ui/src/pages/ReviewInvoice.js | 4 ---- 5 files changed, 22 deletions(-) diff --git a/GrossesMitaines/grosses-mitaines-ui/src/pages/Inventaire.js b/GrossesMitaines/grosses-mitaines-ui/src/pages/Inventaire.js index 4eb5d84..d67eee3 100644 --- a/GrossesMitaines/grosses-mitaines-ui/src/pages/Inventaire.js +++ b/GrossesMitaines/grosses-mitaines-ui/src/pages/Inventaire.js @@ -32,14 +32,12 @@ const Inventaire = () => { const handleAddItem = async (morceau) => { - console.log(morceau); let formData = new FormData(); Object.keys(morceau).map((k) => { formData.set(k, morceau[k]); }); - console.log(formData); const response = await fetch(`https://localhost:7292/api/Product`, { method: 'POST', @@ -52,7 +50,6 @@ const Inventaire = () => { }) const newMorceau = await response.json(); - console.log(newMorceau); if (response.ok) { setMorceaux([...morceaux, { ...newMorceau }]); @@ -80,7 +77,6 @@ const Inventaire = () => { mode: 'cors', credentials: 'include' }).then(async (response) => { - console.log(response); if (response.ok) { const deletedId = await response.json(); setMorceaux(morceaux.filter((morceau) => morceau.id !== deletedId)); @@ -88,7 +84,6 @@ const Inventaire = () => { onShowAlert('Suppression de:', `${name} avec succès!`, 2000); } else { - console.log("test"); mySwal.fire({ title: `Erreur lors de la suppression de ${name}`, text: `L'erreur: ${response}`, @@ -103,8 +98,6 @@ const Inventaire = () => { const handleModifyItem = async (morceau, oldTitle) => { - console.log(morceau); - mySwal.fire({ title: `Modifier ${oldTitle}?`, diff --git a/GrossesMitaines/grosses-mitaines-ui/src/pages/Invoices.js b/GrossesMitaines/grosses-mitaines-ui/src/pages/Invoices.js index 7274ec6..1172408 100644 --- a/GrossesMitaines/grosses-mitaines-ui/src/pages/Invoices.js +++ b/GrossesMitaines/grosses-mitaines-ui/src/pages/Invoices.js @@ -22,7 +22,6 @@ const Invoices = () => { }).then(async (response) => { if (response.ok) { var json = await response.json(); - console.log(json); setInvoices(json); } else{ @@ -47,7 +46,6 @@ const Invoices = () => { mode: 'cors', credentials: 'include' }).then(async (response) => { - console.log(response); if (response.ok) { const deletedId = await response.json(); setInvoices(invoices.filter((invoice) => invoice.id !== deletedId)); @@ -55,7 +53,6 @@ const Invoices = () => { onShowAlert('Suppression de la commande avec succès!', 2000); } else { - console.log("test"); mySwal.fire({ title: `Erreur lors de la suppression de la commande...`, text: `L'erreur: ${response}`, diff --git a/GrossesMitaines/grosses-mitaines-ui/src/pages/MyAddresses.js b/GrossesMitaines/grosses-mitaines-ui/src/pages/MyAddresses.js index 00d76ba..0a37ced 100644 --- a/GrossesMitaines/grosses-mitaines-ui/src/pages/MyAddresses.js +++ b/GrossesMitaines/grosses-mitaines-ui/src/pages/MyAddresses.js @@ -70,7 +70,6 @@ const MyAddresses = () => { mode: 'cors', credentials: 'include' }).then(async (response) => { - console.log(response); if (response.ok) { const deletedId = await response.json(); setUserAddresses(userAddresses.filter((address) => address.id !== deletedId)); @@ -78,7 +77,6 @@ const MyAddresses = () => { onShowAlert('Suppression de:', `${address.civicNumber} ${address.street} avec succès!`, 2000); } else { - console.log("test"); mySwal.fire({ title: `Erreur lors de la suppression de ${address.civicNumber} ${address.street}`, text: `L'erreur: ${response}`, @@ -91,14 +89,12 @@ const MyAddresses = () => { } const onSubmit = async (address) => { - console.log(address); let formData = new FormData(); Object.keys(address).map((k) => { formData.set(k, address[k]); }); - console.log(formData); const response = await fetch(`https://localhost:7292/api/Address`, { method: 'POST', @@ -111,7 +107,6 @@ const MyAddresses = () => { }) const newAddress = await response.json(); - console.log(newAddress); if (response.ok) { setUserAddresses([...userAddresses, { ...newAddress }]); diff --git a/GrossesMitaines/grosses-mitaines-ui/src/pages/MyInvoices.js b/GrossesMitaines/grosses-mitaines-ui/src/pages/MyInvoices.js index 0689365..c9e5411 100644 --- a/GrossesMitaines/grosses-mitaines-ui/src/pages/MyInvoices.js +++ b/GrossesMitaines/grosses-mitaines-ui/src/pages/MyInvoices.js @@ -22,7 +22,6 @@ const MyInvoices = () => { }).then(async (response) => { if (response.ok) { var json = await response.json(); - console.log(json); setInvoices(json); } else{ @@ -47,7 +46,6 @@ const MyInvoices = () => { mode: 'cors', credentials: 'include' }).then(async (response) => { - console.log(response); if (response.ok) { const deletedId = await response.json(); setInvoices(invoices.filter((invoice) => invoice.id !== deletedId)); @@ -55,7 +53,6 @@ const MyInvoices = () => { onShowAlert('Suppression de la commande avec succès!', 2000); } else { - console.log("test"); mySwal.fire({ title: `Erreur lors de la suppression de la commande...`, text: `L'erreur: ${response}`, diff --git a/GrossesMitaines/grosses-mitaines-ui/src/pages/ReviewInvoice.js b/GrossesMitaines/grosses-mitaines-ui/src/pages/ReviewInvoice.js index cdc35e4..2dbbefa 100644 --- a/GrossesMitaines/grosses-mitaines-ui/src/pages/ReviewInvoice.js +++ b/GrossesMitaines/grosses-mitaines-ui/src/pages/ReviewInvoice.js @@ -112,14 +112,12 @@ const ReviewInvoice = () => { } const handleConfirmer = async () => { - console.log(thisInvoice); // let formData = new FormData(); // Object.keys(thisInvoice).map((k) => { // formData.set(k, thisInvoice[k]); // }); - // console.log(formData); const json = JSON.stringify(thisInvoice); const response = await fetch(`https://localhost:7292/api/Invoice`, { @@ -132,8 +130,6 @@ const ReviewInvoice = () => { }, body: json }) - console.log(json); - console.log(await response.json()); if (response.ok) { mySwal.fire({ title: 'Commande envoyée avec succès!',