From c084d6ba45847b98459fc32ed19db866456de4dc Mon Sep 17 00:00:00 2001
From: Malo LE ROUX <vigilionstudio@gmail.com>
Date: Wed, 31 May 2023 12:53:19 +0200
Subject: [PATCH] Correction requete user

---
 api/api.js | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/api/api.js b/api/api.js
index 5078880..eb61668 100644
--- a/api/api.js
+++ b/api/api.js
@@ -51,7 +51,7 @@ module.exports = (passport) => {
          res.send();
       });
    })
-   app.put('/produit/:id', besoinAuth, besoinAuth, async function (req, res) {
+   app.put('/produit/:id', besoinAuth, async function (req, res) {
       let query = "Update Produit set";
       let params = [];
       if(req.body.qte_max !== undefined) {
@@ -101,8 +101,8 @@ module.exports = (passport) => {
       });
    })
 
-   app.get('/user/:id', besoinAuth, besoinAuth, async function (req, res) {
-      db.query("Select * from Cafetier id_cafetier = ?",[req.params["id"]], function (err, result, fields) {
+   app.get('/user/:id', besoinAuth, async function (req, res) {
+      db.query("Select * from Cafetier WHERE id_cafetier = ?",[req.params["id"]], function (err, result, fields) {
          if (err) return res.status(400).send();
          res.send(JSON.stringify(result));
       });
-- 
GitLab