frontend & backend update

This commit is contained in:
carodej
2020-06-19 08:03:29 +02:00
parent 95bc310def
commit a2cab6198e
83 changed files with 4464 additions and 1907 deletions

View File

@@ -11,22 +11,26 @@ const defaultState = {
const actions = {
getAppData: ({commit, getters}) => {
return new Promise((resolve, reject) => {
axios
.get(getters.api + '/user')
.then((response) => {
resolve(response)
axios
.get(getters.api + '/user')
.then((response) => {
commit('RETRIEVE_USER', response.data)
commit('RETRIEVE_USER', response.data)
}).catch((error) => {
}).catch((error) => {
reject(error)
// Redirect if unauthenticated
if ([401, 403].includes(error.response.status)) {
// Redirect if unauthenticated
if ([401, 403].includes(error.response.status)) {
commit('SET_AUTHORIZED', false)
router.push({name: 'SignIn'})
commit('SET_AUTHORIZED', false)
router.push({name: 'SignIn'})
}
}
}
)
)
})
},
logOut: ({getters, commit}) => {
axios