File tree Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change 1- import { secureFetch } from '../../common/actions'
2- import { getFeed } from '../../common/util/modules'
1+ import { secureFetch } from '../../common/actions'
2+ import { getFeed , getFeedId } from '../../common/util/modules'
33import { getActiveProject } from '../../manager/selectors'
44
55export function updatingGtfsFilter ( activeProject , user ) {
@@ -27,15 +27,13 @@ export function updateMapState (props) {
2727export function updateGtfsFilter ( activeProject , user ) {
2828 return function ( dispatch , getState ) {
2929 dispatch ( updatingGtfsFilter ( activeProject , user ) )
30-
30+ const projectFeeds = getActiveProject ( getState ( ) ) . feedSources
3131 // check GTFS API for feed IDs present in cache
32- return dispatch ( secureFetch ( ' /api/manager/feeds' ) )
32+ return dispatch ( secureFetch ( ` /api/manager/feeds?id= ${ projectFeeds . map ( f => getFeedId ( f ) ) . filter ( n => n ) . join ( ',' ) } ` ) )
3333 . then ( response => response . json ( ) )
3434 . then ( ( feedIds ) => {
35- const activeFeeds = getActiveProject ( getState ( ) ) . feedSources
36-
3735 // filter out null values
38- const feeds = feedIds ? feedIds . map ( id => getFeed ( activeFeeds , id ) ) . filter ( n => n ) : [ ]
36+ const feeds = feedIds ? feedIds . map ( id => getFeed ( projectFeeds , id ) ) . filter ( n => n ) : [ ]
3937 dispatch ( updateLoadedFeeds ( feeds ) )
4038 } )
4139 }
You can’t perform that action at this time.
0 commit comments