commit 3e9facd41c24456f826968448cbf9a860efeedb1
parent aa0ca24bf921ac84fc655cb48b34525348e8d6d6
Author: Yureka <yuka@yuka.dev>
Date: Fri, 20 Aug 2021 16:04:07 +0200
parent aa0ca24bf921ac84fc655cb48b34525348e8d6d6
Author: Yureka <yuka@yuka.dev>
Date: Fri, 20 Aug 2021 16:04:07 +0200
fix stuff
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/server/index.js b/server/index.js @@ -56,8 +56,10 @@ const createMoreJourneys = mode => async (slug, opt) => { const saved = JSON.parse(await db.get(slug)); opt[mode+'Than'] = saved[mode+'Ref']; + const params = { ...saved.params, ...opt }; + let { departure, arrival, from, to, ...moreOpt } = params; const [newData, ...refreshedJourneys] = await Promise.all( - [ hafas.journeys(saved.params.from, saved.params.to, opt) ] + [ hafas.journeys(saved.params.from, saved.params.to, moreOpt) ] .concat(saved.journeys.map(x => hafas.refreshJourney(x, opt))) ); @@ -82,7 +84,7 @@ const createMoreJourneys = mode => async (slug, opt) => { })); return { ...res, - params: { ...saved.params, ...opt }, + params, }; };