fix "Delete fee" on Member Incidents Report screen
This commit is contained in:
@@ -89,13 +89,17 @@ export const fetchIncidents = (dispatch, dateRange) => {
|
||||
};
|
||||
|
||||
export const deleteIncidents = (dispatch, deleteData) => {
|
||||
dispatch({type: FETCH_INCIDENTS_PENDING});
|
||||
const pendingAction = deleteData.memberId ? FETCH_MEMBER_INCIDENTS_PENDING : FETCH_INCIDENTS_PENDING;
|
||||
const successAction = deleteData.memberId ? FETCH_MEMBER_INCIDENTS_SUCCESS : FETCH_INCIDENTS_SUCCESS;
|
||||
const failedAction = deleteData.memberId ? FETCH_MEMBER_INCIDENTS_FAILED : FETCH_INCIDENTS_FAILED;
|
||||
|
||||
dispatch({type: pendingAction});
|
||||
API.delete(`/integration/fees`, { data: deleteData })
|
||||
.then(response => {
|
||||
dispatch({type: FETCH_INCIDENTS_SUCCESS, payload: response.data});
|
||||
dispatch({type: successAction, payload: response.data});
|
||||
})
|
||||
.catch(error => {
|
||||
dispatch({type: FETCH_INCIDENTS_FAILED, payload: error.response});
|
||||
dispatch({type: failedAction, payload: error.response});
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user