From d523e2b8a224672afebfa7117a58b2f22024ac0d Mon Sep 17 00:00:00 2001 From: Tom Russell Date: Mon, 18 Mar 2019 19:51:55 +0000 Subject: [PATCH] Fix return value of /building//like.json - update to fix log noise meant this was always returning true --- app/src/server.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/app/src/server.js b/app/src/server.js index 5bb44cdd..9193ce7f 100644 --- a/app/src/server.js +++ b/app/src/server.js @@ -262,12 +262,8 @@ server.route('/building/:building_id/like.json') } const { building_id } = req.params; getBuildingLikeById(building_id, req.session.user_id).then(like => { - if (typeof (like) === "undefined") { - res.send({ like: false }) - return - } // any value returned means like - res.send({ like: true }) + res.send({ like: like }) }).catch( () => res.send({ error: 'Database error' }) )