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'
3
3
import { getActiveProject } from '../../manager/selectors'
4
4
5
5
export function updatingGtfsFilter ( activeProject , user ) {
@@ -27,15 +27,13 @@ export function updateMapState (props) {
27
27
export function updateGtfsFilter ( activeProject , user ) {
28
28
return function ( dispatch , getState ) {
29
29
dispatch ( updatingGtfsFilter ( activeProject , user ) )
30
-
30
+ const projectFeeds = getActiveProject ( getState ( ) ) . feedSources
31
31
// 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 ( ',' ) } ` ) )
33
33
. then ( response => response . json ( ) )
34
34
. then ( ( feedIds ) => {
35
- const activeFeeds = getActiveProject ( getState ( ) ) . feedSources
36
-
37
35
// 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 ) : [ ]
39
37
dispatch ( updateLoadedFeeds ( feeds ) )
40
38
} )
41
39
}
You can’t perform that action at this time.
0 commit comments