diff --git a/lib/actions/apiV2.js b/lib/actions/apiV2.js index c42e8f7a4..e7deb84e3 100644 --- a/lib/actions/apiV2.js +++ b/lib/actions/apiV2.js @@ -506,13 +506,15 @@ export const fetchNearby = (position, radius, currentServiceWeek) => { export const findStopTimesForStop = (params) => function (dispatch, getState) { dispatch(fetchingStopTimesForStop(params)) - const { date, onlyRequestForOperators, stopId } = params + const { date, stopId } = params const timeZone = getState().otp.config.homeTimezone // Create a service date timestamp from 3:30am local. const serviceDay = getServiceStart(date, timeZone).getTime() / 1000 - const fullStopTimesQuery = `query StopTimes( + return dispatch( + createGraphQLQueryAction( + `query StopTimes( $serviceDay: Long! $stopId: String! ) { @@ -547,13 +549,11 @@ export const findStopTimesForStop = (params) => id: code route { agency { + name gtfsId } gtfsId } - stops { - gtfsId - } } stoptimes { headsign @@ -572,48 +572,7 @@ export const findStopTimesForStop = (params) => } } } - }` - - const shorterStopTimesQueryForOperators = `query StopTimes( - $stopId: String! - ) { - stop(id: $stopId) { - gtfsId - code - routes { - id: gtfsId - agency { - gtfsId - name - } - patterns { - id - headsign - } - } - stoptimesForPatterns(numberOfDepartures: 100, omitNonPickups: true, omitCanceled: false) { - pattern { - desc: name - headsign - id: code - route { - agency { - gtfsId - } - gtfsId - } - } - } - } - }` - - const query = onlyRequestForOperators - ? shorterStopTimesQueryForOperators - : fullStopTimesQuery - - return dispatch( - createGraphQLQueryAction( - query, + }`, { serviceDay, stopId diff --git a/lib/components/map/default-map.tsx b/lib/components/map/default-map.tsx index 5548f8171..412dc0382 100644 --- a/lib/components/map/default-map.tsx +++ b/lib/components/map/default-map.tsx @@ -86,6 +86,8 @@ function getLayerName(overlay, config, intl) { return intl.formatMessage({ id: 'components.MapLayers.streets' }) case 'Satellite': return intl.formatMessage({ id: 'components.MapLayers.satellite' }) + case 'Stops': + return intl.formatMessage({ id: 'components.MapLayers.stops' }) default: if (name) return name } @@ -166,7 +168,6 @@ class DefaultMap extends Component { const stopId = firstStopOfStationId || entity.gtfsId this.props.findStopTimesForStop({ date: getCurrentDate(), - onlyRequestForOperators: true, stopId }) return diff --git a/lib/reducers/create-otp-reducer.js b/lib/reducers/create-otp-reducer.js index c4b3a7811..e753c466c 100644 --- a/lib/reducers/create-otp-reducer.js +++ b/lib/reducers/create-otp-reducer.js @@ -852,7 +852,7 @@ function createOtpReducer(config) { return update(state, { transitIndex: { stops: { - $set: { + $merge: { [action.payload.stopId]: { fetchStatus: FETCH_STATUS.FETCHING }