From 5163e91649cb8726376fb3359dd0d17edf33dbee Mon Sep 17 00:00:00 2001 From: Gautam Anand Date: Sat, 16 Nov 2024 09:21:41 -0600 Subject: [PATCH] Bug fix minor --- server.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server.js b/server.js index 8491d81..0a3f1b0 100644 --- a/server.js +++ b/server.js @@ -233,8 +233,8 @@ app.get('/countryLocations/:country', (req, res) => { if(countryLocations[req.params.country].cacheUpdate && Date.now() - countryLocations[req.params.country].cacheUpdate < 60 * 1000) { console.log('Serving countryLocations from cache'); - - return res.json({ ready: countryLocations[req.params.country].locations>0, locations: countryLocations[req.params.country].locations }); + + return res.json({ ready: countryLocations[req.params.country].locations.length>0, locations: countryLocations[req.params.country].locations }); } else { fetch('http://localhost:3003/countryLocations/'+req.params.country)