diff --git a/lib/actions/apiV2.js b/lib/actions/apiV2.js index 41b492d75..08cd2dde9 100644 --- a/lib/actions/apiV2.js +++ b/lib/actions/apiV2.js @@ -832,12 +832,10 @@ export function findRoutes() { dispatch( createGraphQLQueryAction( - `{ - routes ${ - currentServiceWeek - ? `(serviceDates: {start: "${currentServiceWeek.start}", end: "${currentServiceWeek.end}"})` - : '' - }{ + `query Routes( + $currentServiceWeek: LocalDateRangeInput + ) { + routes (serviceDates: $currentServiceWeek) { id: gtfsId agency { id: gtfsId @@ -852,7 +850,7 @@ export function findRoutes() { } } `, - {}, + { currentServiceWeek }, findRoutesResponse, findRoutesError, { diff --git a/lib/components/viewers/nearby/stop.tsx b/lib/components/viewers/nearby/stop.tsx index f11f443a2..c98d288c1 100644 --- a/lib/components/viewers/nearby/stop.tsx +++ b/lib/components/viewers/nearby/stop.tsx @@ -70,6 +70,8 @@ const Stop = ({ (a: StopTime, b: StopTime) => fullTimestamp(a) - fullTimestamp(b) ) if ( + // NearbyRoutes if present is populated with a list of routes that appear + // in the current service period. stopData.nearbyRoutes && !stopData.nearbyRoutes.includes(st?.pattern?.route?.gtfsId) ) {