Fix lifecycle not updating issue

4.x.x
Jayasanka 6 years ago
parent bd80f5d442
commit 14db806fb0

@ -33,7 +33,8 @@ class ConnectedLifecycleModal extends React.Component {
componentWillReceiveProps(nextProps) {
if (nextProps !== this.props) {
this.setState({
visible: nextProps.visible
visible: nextProps.visible,
loading: false
})
}
}

@ -96,12 +96,10 @@ export const updateLifecycleState = (uuid, nextState, reason) => dispatch => {
const request = "method=post&content-type=application/json&payload=" + JSON.stringify(payload) + "&api-endpoint=/application-mgt-publisher/v1.0/applications/life-cycle/" + uuid;
console.log(request);
return axios.post('https://' + config.serverConfig.hostname + ':' + config.serverConfig.httpsPort + config.serverConfig.invokerUri, request
).then(res => {
if (res.status === 200) {
if(res.data.data.hasOwnProperty("release")) {
if (res.status === 201) {
let release = res.data.data;
dispatch({type: ActionTypes.UPDATE_LIFECYCLE_STATE, payload: release});
}else {
@ -110,7 +108,6 @@ export const updateLifecycleState = (uuid, nextState, reason) => dispatch => {
type: ActionTypes.CLOSE_LIFECYCLE_MODAL
});
}
}
}).catch(function (error) {
if (error.response.status === 401) {

Loading…
Cancel
Save