From 2a6cbf20847af257deda3b537885e0db9611a146 Mon Sep 17 00:00:00 2001 From: Ahmedhossamdev Date: Wed, 21 Aug 2024 23:49:19 +0300 Subject: [PATCH] refactor: parse stopBody to json --- src/routes/stops/[stopID]/+page.server.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/routes/stops/[stopID]/+page.server.js b/src/routes/stops/[stopID]/+page.server.js index 286364a..462ff55 100644 --- a/src/routes/stops/[stopID]/+page.server.js +++ b/src/routes/stops/[stopID]/+page.server.js @@ -4,13 +4,13 @@ import arrivalDepartureAPI from '$lib/RestAPI/arrivalsAndDeparturesForStop.js'; export async function load({ params }) { const stopID = params.stopID; const stopResponse = await stopAPI(stopID); - + const stopBody = await stopResponse.json(); const arrivalsAndDeparturesResponse = await arrivalDepartureAPI(stopID); - const arrivalsAndDeparturesResponseJson = await arrivalsAndDeparturesResponse.json(); + const arrivalsAndDeparturesResponseJSON = await arrivalsAndDeparturesResponse.json(); return { stopID: params.stopID, - stopData: stopResponse.data, - arrivalsAndDeparturesResponse: arrivalsAndDeparturesResponseJson + stopData: stopBody.data, + arrivalsAndDeparturesResponse: arrivalsAndDeparturesResponseJSON }; }