add mappings page; implement delete mapping function
This commit is contained in:
@@ -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', {
|
||||
|
||||
Reference in New Issue
Block a user