mirror of
https://repository.entgra.net/community/device-mgt-core.git
synced 2025-10-06 02:01:45 +00:00
Create action for change lifecycle
This commit is contained in:
parent
c2018da2e8
commit
6b9d24f886
@ -23,7 +23,6 @@ export const getApps = () => dispatch => {
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
};
|
||||
|
||||
export const getRelease = (uuid) => dispatch => {
|
||||
@ -87,3 +86,24 @@ export const getLifecycle = ()=> dispatch =>{
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
export const updateLifecycleState = (uuid, nextState) => dispatch => {
|
||||
|
||||
const request = "method=get&content-type=application/json&payload={}&api-endpoint=/applications/lifecycle-config/"+uuid+"?action="+nextState;
|
||||
|
||||
return axios.post('https://' + config.serverConfig.hostname + ':' + config.serverConfig.httpsPort + config.serverConfig.invokerUri, request
|
||||
).then(res => {
|
||||
if (res.status === 200) {
|
||||
let release = res.data.data;
|
||||
dispatch({type: ActionTypes.GET_RELEASE, payload: release});
|
||||
}
|
||||
|
||||
}).catch(function (error) {
|
||||
if (error.response.status === 401) {
|
||||
window.location.href = 'https://localhost:9443/publisher/login';
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
};
|
||||
|
||||
@ -8,7 +8,8 @@ const ActionTypes = keyMirror({
|
||||
GET_RELEASE: null,
|
||||
GET_LIFECYCLE: null,
|
||||
OPEN_LIFECYCLE_MODAL: null,
|
||||
CLOSE_LIFECYCLE_MODAL: null
|
||||
CLOSE_LIFECYCLE_MODAL: null,
|
||||
UPDATE_LIFECYCLE_STATE: null,
|
||||
});
|
||||
|
||||
export default ActionTypes;
|
||||
Loading…
Reference in New Issue
Block a user