From 37e2e813d1709294514f76f74396d44d50f9fac6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9luchu?= Date: Mon, 1 Jun 2020 15:29:57 +0200 Subject: [PATCH] Return data if not empty on MoreInfo --- src/api/routes/index.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/api/routes/index.js b/src/api/routes/index.js index 40f68d4..73e6a9c 100644 --- a/src/api/routes/index.js +++ b/src/api/routes/index.js @@ -172,9 +172,11 @@ router.get('/moreInfo/:title' , (req, res) =>{ api.getMoreInfo(title) .then(info =>{ - res.status(200).json({ - info - }); + if (info.length > 0) { + res.status(200).json({ + info + }); + } }).catch((err) =>{ console.error(err); });