+ client: handle DHCP reset

This commit is contained in:
Ildar Kamalov
2019-10-15 17:14:24 +03:00
committed by Simon Zolin
parent df92941ae0
commit a4dedacf43
7 changed files with 109 additions and 36 deletions

View File

@@ -470,6 +470,22 @@ export const toggleDhcp = values => async (dispatch) => {
}
};
export const resetDhcpRequest = createAction('RESET_DHCP_REQUEST');
export const resetDhcpSuccess = createAction('RESET_DHCP_SUCCESS');
export const resetDhcpFailure = createAction('RESET_DHCP_FAILURE');
export const resetDhcp = () => async (dispatch) => {
dispatch(resetDhcpRequest());
try {
const status = await apiClient.resetDhcp();
dispatch(resetDhcpSuccess(status));
dispatch(addSuccessToast('dhcp_config_saved'));
} catch (error) {
dispatch(addErrorToast({ error }));
dispatch(resetDhcpFailure());
}
};
export const toggleLeaseModal = createAction('TOGGLE_LEASE_MODAL');
export const addStaticLeaseRequest = createAction('ADD_STATIC_LEASE_REQUEST');