-
+
-
+
{{ invite.to_user.firstname }}
{{ invite.to_user.lastname }}
@@ -152,7 +152,7 @@
v-for="(request, index) in getRequests(day.date)"
:key="index"
>
-
+
{{ request.to_user.firstname }}
{{ request.to_user.lastname }}
@@ -344,7 +344,6 @@ export default {
return jobkinddate.job_kind
},
filteredDBUsersWithJobKind() {
- console.log(this.day.jobkinddate)
var retVal = this.filteredDBUsers()
var job_kind = this.getJob_Kind()
diff --git a/src/plugins/routes.js b/src/plugins/routes.js
index 57d97c4..f0c7d92 100644
--- a/src/plugins/routes.js
+++ b/src/plugins/routes.js
@@ -72,7 +72,8 @@ const url = {
storno: main + 'user/storno',
getAllStatus: main + 'getAllStatus',
getStatus: main + 'getStatus',
- valid: main + 'valid'
+ valid: main + 'valid',
+ getAccessTokens: main + 'user/getAccessTokens'
},
barU: {
storno: main + 'bar/storno',
diff --git a/src/store/modules/jobRequests.js b/src/store/modules/jobRequests.js
index cf9af9e..92c8df1 100644
--- a/src/store/modules/jobRequests.js
+++ b/src/store/modules/jobRequests.js
@@ -158,13 +158,11 @@ const mutations = {
: []
}
})
- console.log(mop)
},
setDayLoading: (state, { getters, date, value }) => {
let day = getters.getDayToMe(date)
day.forEach(a => {
a.day.loading = value
- console.log('day', value ? 'loading' : 'not loading', day, a.day.loading)
})
},
deleteJobRequestFromMe: (state, jobrequest) => {
@@ -240,7 +238,6 @@ const actions = {
to_me.data,
{ headers: { Token: rootState.login.user.accessToken } }
)
- console.log(to_me.data)
commit('setJobRequestsToMe', to_me.data)
workers_to_me.data.forEach(item => {
var date = new Date(
diff --git a/src/store/modules/login.js b/src/store/modules/login.js
index f199244..dc45cd0 100644
--- a/src/store/modules/login.js
+++ b/src/store/modules/login.js
@@ -157,9 +157,7 @@ const actions = {
})
commit('setLifeTime', response.data.value)
var user = JSON.parse(localStorage.getItem('user'))
- console.log('user',user)
user.group = response.data.group
- console.log('after',user)
localStorage.setItem('user', JSON.stringify(user))
commit('updateAccessToken', user)
} catch (e) {
diff --git a/src/store/modules/user.js b/src/store/modules/user.js
index 7c3fce4..2f1ec2d 100644
--- a/src/store/modules/user.js
+++ b/src/store/modules/user.js
@@ -9,7 +9,8 @@ const state = {
error: '',
days: [],
messages: [],
- status: []
+ status: [],
+ tokens: []
}
const mutations = {
@@ -29,6 +30,9 @@ const mutations = {
state.creditList = []
state.error = ''
},
+ setTokens: (state, tokens) => {
+ state.tokens = tokens
+ },
createAmount(creditList) {
let amount = {
type: 'Schulden',
@@ -317,6 +321,26 @@ const actions = {
if (e.response)
if (e.response.status === 401) dispatch('logout', null, { root: true })
}
+ },
+ async getTokens({ commit, rootState, dispatch }) {
+ try {
+ const response = await axios.get(url.user.getAccessTokens, {headers: {Token: rootState.login.user.accessToken}})
+ commit('setTokens', response.data)
+ dispatch('getLifeTime', null, { root: true })
+ } catch (e) {
+ if (e.response)
+ if (e.response.status === 401) dispatch('logout', null, { root: true })
+ }
+ },
+ async deleteToken({ commit, rootState, dispatch }, token) {
+ try {
+ const response = await axios.post(url.user.getAccessTokens, token,{headers: {Token: rootState.login.user.accessToken}})
+ commit('setTokens', response.data)
+ dispatch('getLifeTime', null, { root: true })
+ } catch (e) {
+ if (e.response)
+ if (e.response.status === 401) dispatch('logout', null, { root: true })
+ }
}
}
@@ -349,6 +373,9 @@ const getters = {
},
status: state => {
return state.status
+ },
+ tokens: state => {
+ return state.tokens
}
}
diff --git a/src/store/modules/userManager.js b/src/store/modules/userManager.js
index 76a60a5..2ec5529 100644
--- a/src/store/modules/userManager.js
+++ b/src/store/modules/userManager.js
@@ -79,7 +79,6 @@ 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 })
@@ -95,7 +94,6 @@ const actions = {
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 })