Skip to content

Commit

Permalink
feat: add server-side loading for stop schedule
Browse files Browse the repository at this point in the history
  • Loading branch information
Ahmedhossamdev committed Nov 18, 2024
1 parent 6097065 commit a537249
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/routes/stops/[stopID]/schedule/+page.server.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import oba, { handleOBAResponse } from '$lib/obaSdk.js';

export async function load({ params }) {
const stopID = params.stopID;
const response = await oba.scheduleForStop.retrieve(stopID);
const scheduleForStop = await handleOBAResponse(response, 'stop').json();

return {
stopID: params.stopID,
scheduleForStop: scheduleForStop.data
};
}

0 comments on commit a537249

Please sign in to comment.