implement mapping update
This commit is contained in:
@@ -49,6 +49,19 @@ export const deleteMapping = (dispatch, mappingId) => {
|
||||
});
|
||||
};
|
||||
|
||||
export const updateMapping = (dispatch, id, mapping) => {
|
||||
dispatch({type: FETCH_MAPPINGS_PENDING});
|
||||
API.put(`integration/mappings/${id}`, {
|
||||
mapping
|
||||
})
|
||||
.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