diff --git a/src/components/vorstand/ServiceManagement.vue b/src/components/vorstand/ServiceManagement.vue index e4fdddb..f49de24 100644 --- a/src/components/vorstand/ServiceManagement.vue +++ b/src/components/vorstand/ServiceManagement.vue @@ -109,7 +109,7 @@ export default { getAllUsers: 'sm/getAllUsers', getUsers: 'sm/getUsers', lockDay: 'sm/lockDay', - getDBUsers: 'usermanager/getUsers', + getDBUsers: 'usermanager/getUsersWithExtern', getAllJobKinds: 'jkm/getAllJobKinds', }), changeMonth(value) { diff --git a/src/store/modules/userManager.js b/src/store/modules/userManager.js index c63ec42..76a60a5 100644 --- a/src/store/modules/userManager.js +++ b/src/store/modules/userManager.js @@ -79,6 +79,23 @@ const actions = { const response = await axios.get(url.getUsers, { headers: { Token: rootState.login.user.accessToken } }) + console.log(response.data) + commit('setUsers', response.data) + commit('setUsersLoading', false) + dispatch('getLifeTime', null, { root: true }) + } catch (e) { + commit('setUsersLoading', false) + if (e.response) + if (e.response.status === 401) dispatch('logout', null, { root: true }) + } + }, + async getUsersWithExtern({ commit, rootState, dispatch }) { + try { + commit('setUsersLoading', true) + const response = await axios.get(url.getUsers + '?extern=1', { + headers: { Token: rootState.login.user.accessToken } + }) + console.log(response.data) commit('setUsers', response.data) commit('setUsersLoading', false) dispatch('getLifeTime', null, { root: true })