add action for sending update data to backend
This commit is contained in:
@@ -103,6 +103,21 @@ export const deleteIncidents = (dispatch, deleteData) => {
|
||||
});
|
||||
};
|
||||
|
||||
export const updateIncidentFees = (dispatch, updateData) => {
|
||||
const pendingAction = updateData.memberId ? FETCH_MEMBER_INCIDENTS_PENDING : FETCH_INCIDENTS_PENDING;
|
||||
const successAction = updateData.memberId ? FETCH_MEMBER_INCIDENTS_SUCCESS : FETCH_INCIDENTS_SUCCESS;
|
||||
const failedAction = updateData.memberId ? FETCH_MEMBER_INCIDENTS_FAILED : FETCH_INCIDENTS_FAILED;
|
||||
|
||||
dispatch({type: pendingAction});
|
||||
API.patch(`/integration/fees`, updateData)
|
||||
.then(response => {
|
||||
dispatch({type: successAction, payload: response.data});
|
||||
})
|
||||
.catch(error => {
|
||||
dispatch({type: failedAction, payload: error.response});
|
||||
});
|
||||
};
|
||||
|
||||
export const fetchMembersList = (dispatch) => {
|
||||
dispatch({type: FETCH_MEMBERS_PENDING});
|
||||
API.get('officeRnD/membersList')
|
||||
|
||||
Reference in New Issue
Block a user