From 34c14e03bf9ccb8f170a3fe7b2db05810a293626 Mon Sep 17 00:00:00 2001 From: Jonasz Bigda Date: Thu, 8 Oct 2020 14:30:53 +0200 Subject: [PATCH] error log --- routes/routeSearch.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/routes/routeSearch.js b/routes/routeSearch.js index 8453d53..a35b39c 100644 --- a/routes/routeSearch.js +++ b/routes/routeSearch.js @@ -7,7 +7,7 @@ var router = express.Router(); // SEARCH RESTAURANTS BY NAME OR CITY -router.get("/", (req, res) => { +router.get("/", async (req, res) => { if (req.query.string.length > 0) { const query = sanitizer.sanitize.keepUnicode(decodeURI(req.query.string)); const regex = new RegExp(query, "i"); @@ -23,6 +23,7 @@ router.get("/", (req, res) => { "_id name city imgUrl workingHours description tags location links", (err, results) => { if (err) { + console.log(err); res.sendStatus(500); } else { res.send(results);