From c4e3f86e319e63e764161c1f7dd81d6fec7501d3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?In=C3=A8s=20Yeterian?= <ines.yeterian@student-cs.fr>
Date: Sun, 16 Jan 2022 20:58:16 +0100
Subject: [PATCH] try to speak mangoose

---
 backend/routes/routesToucan.js | 25 ++++++++++++-------------
 1 file changed, 12 insertions(+), 13 deletions(-)

diff --git a/backend/routes/routesToucan.js b/backend/routes/routesToucan.js
index 9629837..f030712 100644
--- a/backend/routes/routesToucan.js
+++ b/backend/routes/routesToucan.js
@@ -172,20 +172,19 @@ router.get('/pdf/:urlId', (req, res) => {
             }
           });
 
-router.get('/pdf/url', (req, res) => {
+router.get('/pdf/urlID', (req, res) => {
     try {  
-        urltoucans.
-        exec((err,data) => {
-            if (err) {
-                console.log(err);
+            urltoucans.exec((err,data) => {
+                if (err) {
+                    console.log(err);
                       
                 } else {
-                      res.json(data);
-                }});
-            } catch (err) {
-                console.log(err);
-                res.sendStatus(401);
-            }
-        });
-
+                    res.send(data);
+                  }});
+                } catch (err) {
+                  console.log(err);
+                  res.sendStatus(401);
+                }
+              });
+    
 module.exports = router;
\ No newline at end of file
-- 
GitLab