Skip to content

Commit cb3a1e7

Browse files
fix(feeds.js): format labels to be supported by server
1 parent ccb4afb commit cb3a1e7

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

lib/manager/actions/feeds.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@ import {createAction, type ActionType} from 'redux-actions'
55

66
import {createVoidPayloadAction, secureFetch} from '../../common/actions'
77
import {isModuleEnabled} from '../../common/util/config'
8-
import {fetchFeedSourceDeployments} from './deployments'
98
import {fetchSnapshots} from '../../editor/actions/snapshots'
9+
import type {Feed, NewFeed} from '../../types'
10+
import type {dispatchFn, getStateFn} from '../../types/reducers'
11+
12+
import {fetchFeedSourceDeployments} from './deployments'
1013
import {fetchProject, fetchProjectWithFeeds} from './projects'
1114
import {handleJobResponse} from './status'
1215
import {fetchFeedVersions} from './versions'
1316

14-
import type {Feed, NewFeed} from '../../types'
15-
import type {dispatchFn, getStateFn} from '../../types/reducers'
16-
1717
// Private actions
1818
const requestingFeedSource = createVoidPayloadAction('REQUESTING_FEEDSOURCE')
1919
const requestingFeedSources = createVoidPayloadAction('REQUESTING_FEEDSOURCES')
@@ -81,6 +81,8 @@ export function createFeedSource (newFeed: NewFeed) {
8181
export function updateFeedSource (feedSource: Feed, properties: {[string]: any}) {
8282
return function (dispatch: dispatchFn, getState: getStateFn) {
8383
dispatch(savingFeedSource())
84+
// Convert feed source labels to format wanted by datatools-server
85+
feedSource.labels = feedSource.labels.map(label => label.id)
8486
return dispatch(secureFetch(`${FS_URL}/${feedSource.id}`, 'put', {...feedSource, ...properties}))
8587
// Re-fetch feed source with versions and snapshots.
8688
.then((res) => dispatch(fetchFeedSource(feedSource.id)))

0 commit comments

Comments
 (0)