all: sync with master; upd chlog
This commit is contained in:
@@ -32,19 +32,19 @@ export const getAllBlockedServices = () => async (dispatch) => {
|
||||
}
|
||||
};
|
||||
|
||||
export const setBlockedServicesRequest = createAction('SET_BLOCKED_SERVICES_REQUEST');
|
||||
export const setBlockedServicesFailure = createAction('SET_BLOCKED_SERVICES_FAILURE');
|
||||
export const setBlockedServicesSuccess = createAction('SET_BLOCKED_SERVICES_SUCCESS');
|
||||
export const updateBlockedServicesRequest = createAction('UPDATE_BLOCKED_SERVICES_REQUEST');
|
||||
export const updateBlockedServicesFailure = createAction('UPDATE_BLOCKED_SERVICES_FAILURE');
|
||||
export const updateBlockedServicesSuccess = createAction('UPDATE_BLOCKED_SERVICES_SUCCESS');
|
||||
|
||||
export const setBlockedServices = (values) => async (dispatch) => {
|
||||
dispatch(setBlockedServicesRequest());
|
||||
export const updateBlockedServices = (values) => async (dispatch) => {
|
||||
dispatch(updateBlockedServicesRequest());
|
||||
try {
|
||||
await apiClient.setBlockedServices(values);
|
||||
dispatch(setBlockedServicesSuccess());
|
||||
await apiClient.updateBlockedServices(values);
|
||||
dispatch(updateBlockedServicesSuccess());
|
||||
dispatch(getBlockedServices());
|
||||
dispatch(addSuccessToast('blocked_services_saved'));
|
||||
} catch (error) {
|
||||
dispatch(addErrorToast({ error }));
|
||||
dispatch(setBlockedServicesFailure());
|
||||
dispatch(updateBlockedServicesFailure());
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user