fix with extern user

This commit is contained in:
Tim Gröger 2020-05-22 21:38:15 +02:00
parent bc2289173f
commit 0a6994e107
2 changed files with 18 additions and 1 deletions

View File

@ -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) {

View File

@ -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 })