Skip to content

Commit

Permalink
refactor: parse stopBody to json
Browse files Browse the repository at this point in the history
  • Loading branch information
Ahmedhossamdev committed Aug 21, 2024
1 parent f2fef32 commit 2a6cbf2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/routes/stops/[stopID]/+page.server.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
};
}

0 comments on commit 2a6cbf2

Please sign in to comment.