From 40d48da6ee435fb6f1f311e8f1e64710d846f348 Mon Sep 17 00:00:00 2001
From: Fabien Zucchet <fabien.zucchet@student-cs.fr>
Date: Wed, 3 Mar 2021 08:43:45 +0100
Subject: [PATCH] Remove a few console.log()

---
 back/src/controllers/administrateur.controller.js           | 6 +-----
 back/src/controllers/auth.controller.js                     | 3 ---
 back/src/controllers/staffeurs.controller.js                | 1 -
 front_thomas/src/components/ListeAssociations.js            | 2 --
 .../Login/Autocomplete/AddParticipantIfNotExists.js         | 3 +--
 .../components/Login/Gestion/gestionScore/AfficheScore.js   | 2 --
 front_thomas/src/components/Login/NewParticipant.js         | 1 -
 7 files changed, 2 insertions(+), 16 deletions(-)

diff --git a/back/src/controllers/administrateur.controller.js b/back/src/controllers/administrateur.controller.js
index 0ff3b6d5..2daa25c6 100644
--- a/back/src/controllers/administrateur.controller.js
+++ b/back/src/controllers/administrateur.controller.js
@@ -94,7 +94,6 @@ async function getUsers(req, res) {
     let result;
     const request = `query{searchUsers(name:"${req.query.userString}",limit:10){user{firstName,lastName,login}}}`;
     const query = `https://api.linkcs.fr/v1/graphql/?query=${encodeURIComponent(request)}`;
-    console.log(query)
     await fetch(query, {
       method: 'GET',
       headers: {
@@ -112,7 +111,6 @@ async function getUsers(req, res) {
       res.send(err)
     })
     if (result) {
-      console.log(result)
       return res.json(result.data.searchUsers.map(el => el.user))
     } else {
       res.status(500);
@@ -129,7 +127,6 @@ async function getUsersPerformance(req, res) {
     let result;
     const request = `query{searchUsers(name:"${req.query.userString}",limit:10){user{firstName,lastName,login}}}`;
     const query = `https://api.linkcs.fr/v1/graphql/?query=${encodeURIComponent(request)}`;
-    console.log(query)
     await fetch(query, {
       method: 'GET',
       headers: {
@@ -147,7 +144,7 @@ async function getUsersPerformance(req, res) {
       res.send(err)
     })
     if (result) {
-      console.log(result)
+      (result)
       return res.json(result.data.searchUsers.map(el => el.user))
     } else {
       res.status(500);
@@ -164,7 +161,6 @@ function simple_query(query, args) {
     var sql = mysql.format(query, args);
     connection.query(sql, function (error, results) {
       if (error) {
-        console.log('SQL ERROR')
         console.log(error)
         reject(error)
       }
diff --git a/back/src/controllers/auth.controller.js b/back/src/controllers/auth.controller.js
index 38e6f50b..d55bf149 100644
--- a/back/src/controllers/auth.controller.js
+++ b/back/src/controllers/auth.controller.js
@@ -60,9 +60,6 @@ async function getToken(code) {
 
     })
 
-
-    console.log(data);
-
     req.on('error', err => {
       reject(err);
     });
diff --git a/back/src/controllers/staffeurs.controller.js b/back/src/controllers/staffeurs.controller.js
index fc8b8cd9..4edf5d2e 100644
--- a/back/src/controllers/staffeurs.controller.js
+++ b/back/src/controllers/staffeurs.controller.js
@@ -79,7 +79,6 @@ function simple_query(query, args) {
     var sql = mysql.format(query, args);
     connection.query(sql, function (error, results) {
       if (error) {
-        console.log('SQL ERROR')
         console.log(error)
         reject(error)
       }
diff --git a/front_thomas/src/components/ListeAssociations.js b/front_thomas/src/components/ListeAssociations.js
index e89e9ce3..8f57494d 100644
--- a/front_thomas/src/components/ListeAssociations.js
+++ b/front_thomas/src/components/ListeAssociations.js
@@ -11,8 +11,6 @@ export default function GetAssociations (props) {
     return () => clearInterval(interval);
     }, []);
 
-    console.log(associations)
-
     var listeAssos = "";
     associations.map((item) =>
         listeAssos = listeAssos+item.equipe+" / "
diff --git a/front_thomas/src/components/Login/Autocomplete/AddParticipantIfNotExists.js b/front_thomas/src/components/Login/Autocomplete/AddParticipantIfNotExists.js
index 1de034be..e6a9ee53 100644
--- a/front_thomas/src/components/Login/Autocomplete/AddParticipantIfNotExists.js
+++ b/front_thomas/src/components/Login/Autocomplete/AddParticipantIfNotExists.js
@@ -16,10 +16,9 @@ const addParticipant = (props) => {
     });
   };
 
-export default function AddIfNotExists(props) {  
+export default function AddIfNotExists(props) {
 
   if (!useIsParticipant(props)) {
-    console.log("hey !");
     addParticipant(props);
   }
 
diff --git a/front_thomas/src/components/Login/Gestion/gestionScore/AfficheScore.js b/front_thomas/src/components/Login/Gestion/gestionScore/AfficheScore.js
index 017673d4..b9f42d0b 100644
--- a/front_thomas/src/components/Login/Gestion/gestionScore/AfficheScore.js
+++ b/front_thomas/src/components/Login/Gestion/gestionScore/AfficheScore.js
@@ -104,8 +104,6 @@ export function UpdateScoreEquipe({ match }){
   const [equipes,setEquipes] = useState([]);
   useEffect(() => {axios.get('/api/equipes').then((response) => setEquipes(response.data))}, []);
 
-  console.log(equipes);
-
   const { register, handleSubmit } = useForm();
   const onSubmit = data => {editEquipe(data)}
 
diff --git a/front_thomas/src/components/Login/NewParticipant.js b/front_thomas/src/components/Login/NewParticipant.js
index 45e097a1..ce965a51 100644
--- a/front_thomas/src/components/Login/NewParticipant.js
+++ b/front_thomas/src/components/Login/NewParticipant.js
@@ -13,7 +13,6 @@ export default function addParticipantIfNotExists (props) {
     return () => clearInterval(interval);
   }, []);
 
-  console.log(participants);
 
 
 
-- 
GitLab