From 999c8a93e90c3104ff97a31820ed534191934f10 Mon Sep 17 00:00:00 2001 From: miles-grant-ibigroup Date: Mon, 7 Oct 2024 12:56:23 -0400 Subject: [PATCH] complete pr feedback addressing --- lib/actions/apiV2.js | 12 +++++------- lib/components/viewers/nearby/stop.tsx | 2 ++ 2 files changed, 7 insertions(+), 7 deletions(-) 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) ) {