diff --git a/src/store/modules/users.js b/src/store/modules/users.js index 0b6061cb..76a844bb 100644 --- a/src/store/modules/users.js +++ b/src/store/modules/users.js @@ -124,6 +124,10 @@ const users = { dispatch('ApplyChanges', { updatedUsers, callApiFn, userId: _userId }) }, + ClearUsersState({ commit }) { + commit('SET_SEARCH_QUERY', '') + commit('SET_USERS_FILTERS', { local: false, external: false, active: false, deactivated: false }) + }, async ClearFilters({ commit, dispatch, state }) { commit('CLEAR_USERS_FILTERS') dispatch('SearchUsers', { query: state.searchQuery, page: 1 }) diff --git a/src/views/users/index.vue b/src/views/users/index.vue index d3edbf5b..56df8612 100644 --- a/src/views/users/index.vue +++ b/src/views/users/index.vue @@ -179,6 +179,9 @@ export default { this.$store.dispatch('NeedReboot') this.$store.dispatch('FetchUsers', { page: 1 }) }, + destroyed() { + this.$store.dispatch('ClearUsersState') + }, methods: { activationIcon(status) { return status ? 'el-icon-error' : 'el-icon-success'