From 4bea4838c863c249c9e59d1282614db7d92f102e Mon Sep 17 00:00:00 2001 From: soraefir Date: Thu, 24 Aug 2023 10:13:40 +0200 Subject: [PATCH] Fixed foreach --- router/api.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/router/api.js b/router/api.js index c57408c..d651e0e 100644 --- a/router/api.js +++ b/router/api.js @@ -50,12 +50,12 @@ module.exports = (fastify, opts, done) => { let file = '' const data = JSON.parse(val); const gen_wpt = (name,desc,latlon,icon="Flag") => `0${name}-${desc}${icon}` - data.main.array.forEach(a => { + data.main.forEach(a => { file+= gen_wpt(a.hotel.name, a.hotel.notes, a.hotel.latlon, icon="Hotel"); - a.places.restaurants.array.forEach(b => { + a.places.restaurants.forEach(b => { file+= gen_wpt(b.name, b.notes, b.latlon, icon="Restaurant"); }); - a.places.activities.array.forEach(b => { + a.places.activities.forEach(b => { file+= gen_wpt(b.name, b.notes, b.latlon, icon="Tree"); }); });