add mappings page; implement delete mapping function

This commit is contained in:
Bilal Catic
2019-08-28 10:19:28 +02:00
parent 94f0bcc748
commit 4999b1323f
5 changed files with 209 additions and 0 deletions

View File

@@ -38,6 +38,17 @@ export const fetchMappings = (dispatch) => {
});
};
export const deleteMapping = (dispatch, mappingId) => {
dispatch({type: FETCH_MAPPINGS_PENDING});
API.delete(`integration/mappings/${mappingId}`)
.then(response => {
dispatch({type: FETCH_MAPPINGS_SUCCESS, payload: response.data});
})
.catch(error => {
dispatch({type: FETCH_MAPPINGS_FAILED, payload: error.response});
});
};
export const addNewMapping = (dispatch, mapping) => {
dispatch({type: ADD_NEW_MAPPING_PENDING});
API.post('integration/mappings', {