- client: Clear result of checking the filtering result after moving to another page

Close #1548

* commit 'f0b6340e4f3ff36d1068d506564bb68f5f17fa7d':
  - client: Clear result of checking the filtering result after moving to another page
This commit is contained in:
Artem Baskal 2020-04-09 14:25:38 +03:00
commit 6f1fe89bd7
2 changed files with 12 additions and 2 deletions

View File

@ -164,11 +164,17 @@ export const checkHostRequest = createAction('CHECK_HOST_REQUEST');
export const checkHostFailure = createAction('CHECK_HOST_FAILURE'); export const checkHostFailure = createAction('CHECK_HOST_FAILURE');
export const checkHostSuccess = createAction('CHECK_HOST_SUCCESS'); export const checkHostSuccess = createAction('CHECK_HOST_SUCCESS');
/**
*
* @param {object} host
* @param {string} host.name
* @returns {undefined}
*/
export const checkHost = host => async (dispatch) => { export const checkHost = host => async (dispatch) => {
dispatch(checkHostRequest()); dispatch(checkHostRequest());
try { try {
const data = await apiClient.checkHost(host); const data = await apiClient.checkHost(host);
const [hostname] = Object.values(host); const { name: hostname } = host;
dispatch(checkHostSuccess({ dispatch(checkHostSuccess({
hostname, hostname,

View File

@ -13,7 +13,11 @@ const filtering = handleActions(
return { ...state, userRules }; return { ...state, userRules };
}, },
[actions.getFilteringStatusRequest]: state => ({ ...state, processingFilters: true }), [actions.getFilteringStatusRequest]: state => ({
...state,
processingFilters: true,
check: {},
}),
[actions.getFilteringStatusFailure]: state => ({ ...state, processingFilters: false }), [actions.getFilteringStatusFailure]: state => ({ ...state, processingFilters: false }),
[actions.getFilteringStatusSuccess]: (state, { payload }) => ({ [actions.getFilteringStatusSuccess]: (state, { payload }) => ({
...state, ...state,