Merge "Don't overwrite builds when retrieving the buildset"
This commit is contained in:
commit
ead3e52370
|
@ -376,18 +376,16 @@ const failedBuildset = error => ({
|
|||
error
|
||||
})
|
||||
|
||||
const fetchBuildset = (tenant, buildset) => dispatch => {
|
||||
dispatch(requestBuildset())
|
||||
return API.fetchBuildset(tenant.apiPrefix, buildset)
|
||||
.then(response => {
|
||||
if (response.data.builds) {
|
||||
response.data.builds.forEach(build => {
|
||||
dispatch(receiveBuild(build.uuid, build))
|
||||
})
|
||||
}
|
||||
dispatch(receiveBuildset(buildset, response.data))
|
||||
})
|
||||
.catch(error => dispatch(failedBuildset(error)))
|
||||
export function fetchBuildset(tenant, buildsetId) {
|
||||
return async function(dispatch) {
|
||||
dispatch(requestBuildset())
|
||||
try {
|
||||
const response = await API.fetchBuildset(tenant.apiPrefix, buildsetId)
|
||||
dispatch(receiveBuildset(buildsetId, response.data))
|
||||
} catch (error) {
|
||||
dispatch(failedBuildset(error))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const shouldFetchBuildset = (buildsetId, state) => {
|
||||
|
|
|
@ -25,7 +25,7 @@ import {
|
|||
} from '@patternfly/react-core'
|
||||
import { BuildIcon } from '@patternfly/react-icons'
|
||||
|
||||
import { fetchBuildsetIfNeeded } from '../actions/build'
|
||||
import { fetchBuildset } from '../actions/build'
|
||||
import { EmptyPage } from '../containers/Errors'
|
||||
import { Fetchable, Fetching } from '../containers/Fetching'
|
||||
import BuildList from '../containers/build/BuildList'
|
||||
|
@ -39,13 +39,9 @@ class BuildsetPage extends React.Component {
|
|||
dispatch: PropTypes.func,
|
||||
}
|
||||
|
||||
updateData = (force) => {
|
||||
updateData = () => {
|
||||
this.props.dispatch(
|
||||
fetchBuildsetIfNeeded(
|
||||
this.props.tenant,
|
||||
this.props.match.params.buildsetId,
|
||||
force
|
||||
)
|
||||
fetchBuildset(this.props.tenant, this.props.match.params.buildsetId)
|
||||
)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue