From 13bc22256156ef9248e4b6dd2f0daeac18622399 Mon Sep 17 00:00:00 2001 From: Tom Russell Date: Fri, 30 Nov 2018 15:54:11 +0000 Subject: [PATCH] Fix is_building/not found logic --- app/src/server.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/app/src/server.js b/app/src/server.js index f03e69da..b5315eca 100644 --- a/app/src/server.js +++ b/app/src/server.js @@ -68,11 +68,10 @@ function frontendRoute(req, res) { context.status = 200; const building_id = parseBuildingURL(req.url); - if (isNaN(building_id)){ + const is_building = (typeof(building_id) !== "undefined"); + if (is_building && isNaN(building_id)){ context.status = 404; } - const is_building = (typeof(building_id) !== "undefined") - Promise.all([ req.session.user_id? getUserById(req.session.user_id) : undefined,