fixed some bugs

This commit is contained in:
Tim Gröger 2020-03-05 21:16:47 +01:00
parent a82d3bf4b6
commit b2428cb5b4
22 changed files with 127 additions and 152 deletions

19
package-lock.json generated
View File

@ -883,9 +883,9 @@
"dev": true "dev": true
}, },
"@hapi/hoek": { "@hapi/hoek": {
"version": "8.5.0", "version": "8.5.1",
"resolved": "https://registry.npmjs.org/@hapi/hoek/-/hoek-8.5.0.tgz", "resolved": "https://registry.npmjs.org/@hapi/hoek/-/hoek-8.5.1.tgz",
"integrity": "sha512-7XYT10CZfPsH7j9F1Jmg1+d0ezOux2oM2GfArAzLwWe4mE2Dr3hVjsAL6+TFY49RRJlCdJDMw3nJsLFroTc8Kw==", "integrity": "sha512-yN7kbciD87WzLGc5539Tn0sApjyiGHAJgKvG9W8C7O+6c7qmoQMfVs0W4bX17eqz6C78QJqqFrtgdK5EWf6Qow==",
"dev": true "dev": true
}, },
"@hapi/joi": { "@hapi/joi": {
@ -10402,11 +10402,6 @@
"integrity": "sha1-QFQRqOfmM5/mTbmiNN4R3DHgK9Q=", "integrity": "sha1-QFQRqOfmM5/mTbmiNN4R3DHgK9Q=",
"dev": true "dev": true
}, },
"tiny-cookie": {
"version": "2.3.1",
"resolved": "https://registry.npmjs.org/tiny-cookie/-/tiny-cookie-2.3.1.tgz",
"integrity": "sha512-C4x1e8dHfKf03ewuN9aIZzzOfN2a6QKhYlnHdzJxmmjMTLqcskI20F+EplszjODQ4SHmIGFJrvUUnBMS/bJbOA=="
},
"tmp": { "tmp": {
"version": "0.0.33", "version": "0.0.33",
"resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz",
@ -10897,14 +10892,6 @@
} }
} }
}, },
"vue-cookie-law": {
"version": "1.12.0",
"resolved": "https://registry.npmjs.org/vue-cookie-law/-/vue-cookie-law-1.12.0.tgz",
"integrity": "sha512-Am8lHqGVD7P6iVkktVE7sZwqZz36oBBKJBBveXwCOOKA7U7XJNveO7kFxJPBrJwOzrsXjbxGIGibg5SpNlJkKg==",
"requires": {
"tiny-cookie": "^2.1.1"
}
},
"vue-eslint-parser": { "vue-eslint-parser": {
"version": "5.0.0", "version": "5.0.0",
"resolved": "https://registry.npmjs.org/vue-eslint-parser/-/vue-eslint-parser-5.0.0.tgz", "resolved": "https://registry.npmjs.org/vue-eslint-parser/-/vue-eslint-parser-5.0.0.tgz",

View File

@ -12,7 +12,6 @@
"@mdi/js": "^4.8.95", "@mdi/js": "^4.8.95",
"core-js": "^3.4.3", "core-js": "^3.4.3",
"vue": "^2.6.10", "vue": "^2.6.10",
"vue-cookie-law": "^1.12.0",
"vue-router": "^3.1.3", "vue-router": "^3.1.3",
"vuetify": "^2.1.0", "vuetify": "^2.1.0",
"vuex": "^3.1.2" "vuex": "^3.1.2"

View File

@ -6,30 +6,17 @@
<span class="px-4" <span class="px-4"
>&copy; {{ new Date().getFullYear() }} Studentenclub Wu 5 e.v.</span >&copy; {{ new Date().getFullYear() }} Studentenclub Wu 5 e.v.</span
> >
<CookieLaw> <CookieNotification />
<template slot-scope="props">
<v-label>Diese Webseite benutzt Cookies in der Art von Local Storage. Dabei werden Daten auf ihrem Local Storage
gespeichert.
Diese Daten werden benutzt, damit Sie sich Anmelden können und sich gegen die REST-API hinter dieser
Webseite Authentifizieren können.
Dabei werden ihr Nutzername, ein AccessToken und ihre Gruppen (welche ihre Rechte sind) gespeichert. Diese
Daten sind Notwendig. Sollten Sie diese nicht Aktzeptieren, können Sie sich nicht Anmelden.</v-label>
<v-row>
<v-btn text color="primary" @click="props.accept">Akzeptieren</v-btn>
<v-btn text color="alert" @click="props.close">Nicht Aktzeptieren</v-btn>
</v-row>
</template>
</CookieLaw>
</v-footer> </v-footer>
</v-app> </v-app>
</template> </template>
<script> <script>
import TitleBar from './components/TitleBar' import TitleBar from './components/TitleBar'
import CookieLaw from 'vue-cookie-law' import CookieNotification from "./components/CookieNotification";
export default { export default {
name: 'App', name: 'App',
components: { TitleBar, CookieLaw }, components: {CookieNotification, TitleBar },
data: () => ({ data: () => ({
// //
}) })

View File

@ -0,0 +1,48 @@
<template>
<v-bottom-sheet persistent v-model="show" hide-overlay>
<v-card>
<v-card-title>
Cookie und Local Storage Hinweis
</v-card-title>
<v-card-text>
Diese Webseite benutzt den Local Storage. Dabei werden Daten in ihm
gespeichert, welche notwendig sind um sich einzuloggen und eingeloggt zu
bleiben. Außerdem sind diese Daten notwendig um mit dem Server zu
kommunizieren. Dabei wird ein Key 'user' angelegt, in welchem ein
Accesstoken, Benutzername, sowie der Name des Benutzers und deren Rechte
gespeichert. Dazu kommt ein Key 'cookie:accepted', falls sie diesem
zustimmen. Diese Daten bleiben solange erhalten bis Sie sich ausloggen
oder der Accesstoken abgelaufen ist und Sie ausgeloggt werden.
</v-card-text>
<v-card-actions>
<v-spacer />
<v-btn text @click="disableNotification()">Ablehnen</v-btn>
<v-btn text color="primary" @click="acceptNotification()">Akzeptieren</v-btn>
</v-card-actions>
</v-card>
</v-bottom-sheet>
</template>
<script>
import { mapGetters, mapActions } from 'vuex'
export default {
name: 'CookieNotification',
methods: {
...mapActions(['acceptNotification', 'disableNotification', 'getCookieAccepted'])
},
created() {
this.getCookieAccepted()
},
computed: {
...mapGetters({
model: 'cookieNotification',
cookie: 'cookieAccepted'
}),
show() {
return !this.cookie ? this.model : false
}
}
}
</script>
<style scoped></style>

View File

@ -262,7 +262,6 @@ export default {
}, 300) }, 300)
}, },
storno(message) { storno(message) {
console.log('storno')
if (!message.error) { if (!message.error) {
if (!this.under5minutes(message.date)) this.dialog = true if (!this.under5minutes(message.date)) this.dialog = true
else { else {

View File

@ -347,8 +347,6 @@ export default {
}, },
watch: { watch: {
activeUser(newVal) { activeUser(newVal) {
// eslint-disable-next-line no-console
console.log(newVal)
this.limit = (newVal.limit / 100).toFixed(2) this.limit = (newVal.limit / 100).toFixed(2)
this.autoLock = { this.autoLock = {
value: newVal.autoLock, value: newVal.autoLock,
@ -356,8 +354,6 @@ export default {
} }
}, },
id(newVal) { id(newVal) {
// eslint-disable-next-line no-console
console.log(newVal)
this.setActiveUser(newVal) this.setActiveUser(newVal)
} }
} }

View File

@ -347,7 +347,6 @@ export default {
deleteDrinkType: 'priceList/deleteDrinkType' deleteDrinkType: 'priceList/deleteDrinkType'
}), }),
editType(item) { editType(item) {
console.log(item)
this.editedType = Object.assign({}, item) this.editedType = Object.assign({}, item)
this.dialogType = true this.dialogType = true
}, },
@ -379,7 +378,6 @@ export default {
}, },
editItem(item) { editItem(item) {
this.editedIndex = item.id this.editedIndex = item.id
console.log('item', item)
this.editedItem = Object.assign({}, item) this.editedItem = Object.assign({}, item)
for (let i in this.editedItem) { for (let i in this.editedItem) {
this.editedItem[i] = isNaN(this.editedItem[i]) this.editedItem[i] = isNaN(this.editedItem[i])
@ -388,7 +386,6 @@ export default {
? null ? null
: (this.editedItem[i] / 100).toFixed(2) : (this.editedItem[i] / 100).toFixed(2)
} }
console.log(this.editedItem)
this.editedItem.type = Object.assign( this.editedItem.type = Object.assign(
{}, {},
this.types.find(a => a.id == item.type) this.types.find(a => a.id == item.type)
@ -401,9 +398,6 @@ export default {
this.deleteDrink({ id: item.id }) this.deleteDrink({ id: item.id })
}, },
save() { save() {
console.log(this.editedItem)
console.log(this.editedIndex)
console.log(!isNaN(this.editedItem.price_extern_club))
var drink = { var drink = {
id: this.editedIndex, id: this.editedIndex,
name: this.editedItem.name, name: this.editedItem.name,
@ -430,7 +424,6 @@ export default {
? this.editedItem.price_extern_club * 100 ? this.editedItem.price_extern_club * 100
: null : null
} }
console.log(drink)
drink.id === -1 ? this.setDrink(drink) : this.updateDrink(drink) drink.id === -1 ? this.setDrink(drink) : this.updateDrink(drink)
this.editedItem = Object.assign({}, this.defaultItem) this.editedItem = Object.assign({}, this.defaultItem)
this.close() this.close()

View File

@ -198,7 +198,6 @@ export default {
return value >= 0 ? 'title green--text' : 'title red--text' return value >= 0 ? 'title green--text' : 'title red--text'
}, },
getAllSum() { getAllSum() {
console.log('getAllSum', this.user)
if (this.user) if (this.user)
return ( return (
this.user.creditList[this.year][2].sum + this.user.creditList[this.year][2].sum +
@ -207,7 +206,6 @@ export default {
return 0 return 0
}, },
storno(message) { storno(message) {
console.log('storno')
if (!message.error) { if (!message.error) {
if (!this.under5minutes(message.date)) this.dialog = true if (!this.under5minutes(message.date)) this.dialog = true
else { else {

View File

@ -31,7 +31,7 @@
</div> </div>
</v-expand-transition> </v-expand-transition>
</v-card-text> </v-card-text>
<div v-if="userInWorker"> <div v-if="userInWorker && day.locked">
<v-card-actions class="text--secondary"> <v-card-actions class="text--secondary">
<v-autocomplete <v-autocomplete
return-object return-object
@ -74,6 +74,7 @@
</div> </div>
<v-spacer /> <v-spacer />
<v-btn <v-btn
text
v-if="!day.locked && v-if="!day.locked &&
!day.loading && !day.loading &&
day.worker.length < 2 && day.worker.length < 2 &&
@ -126,9 +127,6 @@ export default {
deleteJob: 'jobs/deleteJob', deleteJob: 'jobs/deleteJob',
transactJob: 'jobs/transactJob' transactJob: 'jobs/transactJob'
}), }),
test(event) {
console.log('blur', event)
},
send() { send() {
this.transactJob({ this.transactJob({
user: this.requestUser.username, user: this.requestUser.username,
@ -182,16 +180,12 @@ export default {
return users return users
}, },
canDelete() { canDelete() {
console.log(this.day.date)
console.log(this.transactJobs)
var transactJob = this.transactJobs.filter(a => { var transactJob = this.transactJobs.filter(a => {
return a.date - this.day.date === 0 return a.date - this.day.date === 0
}) })
console.log('filter', transactJob)
var test = transactJob.find(a => { var test = transactJob.find(a => {
return a.accepted && a.answerd return a.accepted && a.answerd
}) })
console.log('find', test)
return test return test
} }
}, },

View File

@ -57,7 +57,7 @@
<v-card-actions v-if="!day.loading"> <v-card-actions v-if="!day.loading">
<v-chip class="text-uppercase" :color="lockedColor">{{ lockedText }}</v-chip> <v-chip class="text-uppercase" :color="lockedColor">{{ lockedText }}</v-chip>
<v-spacer /> <v-spacer />
<v-btn @click="lock">{{lockedTextBtn}}</v-btn> <v-btn text @click="lock">{{lockedTextBtn}}</v-btn>
</v-card-actions> </v-card-actions>
</v-card> </v-card>
</div> </div>
@ -113,9 +113,6 @@ export default {
day: this.day.date.getDate() day: this.day.date.getDate()
}) })
}, },
test(event) {
console.log('blur', event)
},
color: day => { color: day => {
if (day) { if (day) {
if (day.date.getDay() === 0 || day.date.getDay() === 1) { if (day.date.getDay() === 0 || day.date.getDay() === 1) {
@ -173,7 +170,6 @@ export default {
for (let user in oldValue) { for (let user in oldValue) {
if (!newValue.includes(oldValue[user])) { if (!newValue.includes(oldValue[user])) {
deletedUser = oldValue[user] deletedUser = oldValue[user]
console.log('deleteUser', deletedUser, this.day.date)
this.deleteUser({ this.deleteUser({
startdatetime: this.day.date, startdatetime: this.day.date,
date: this.day.date.getTime() / 1000, date: this.day.date.getTime() / 1000,
@ -194,9 +190,6 @@ export default {
month: this.day.date.getMonth() + 1, month: this.day.date.getMonth() + 1,
day: this.day.date.getDate() day: this.day.date.getDate()
}) })
},
focused(newVal, oldValue) {
console.log(newVal, oldValue)
} }
} }
} }

View File

@ -174,9 +174,7 @@ export default {
}, 300) }, 300)
}, },
editItem(item) { editItem(item) {
console.log('item', item)
this.editedItem = Object.assign({}, item) this.editedItem = Object.assign({}, item)
console.log(this.editedItem)
this.editedItem.statusgroup = Object.assign( this.editedItem.statusgroup = Object.assign(
{}, {},
this.status.find(a => a.id == item.statusgroup) this.status.find(a => a.id == item.statusgroup)
@ -184,7 +182,6 @@ export default {
this.editedItem.voting = Object.assign({}, this.editedItem.voting = Object.assign({},
item.voting ? {value: true, text: 'ja'} : {value: false, text: 'nein'}) item.voting ? {value: true, text: 'ja'} : {value: false, text: 'nein'})
this.clickItem(this.editedItem.statusgroup) this.clickItem(this.editedItem.statusgroup)
console.log(this.editedItem)
this.editUser = true this.editUser = true
}, },
clickItem(item) { clickItem(item) {

View File

@ -1,7 +1,7 @@
//const main = 'https://192.168.5.128:5000/' //const main = 'https://192.168.5.128:5000/'
const main = 'http://localhost:5000/' //const main = 'http://localhost:5000/'
//const main = 'http://192.168.5.118:5000/' //const main = 'http://192.168.5.118:5000/'
//const main = 'https://groeger-clan.duckdns.org:5000/' const main = 'https://groeger-clan.duckdns.org:5000/'
const url = { const url = {
login: main + 'login', login: main + 'login',

View File

@ -19,18 +19,17 @@ import Config from '@/components/user/Config'
import Jobs from '@/components/user/Jobs' import Jobs from '@/components/user/Jobs'
import JobRequests from '@/components/user/JobRequests' import JobRequests from '@/components/user/JobRequests'
import PriceList from '@/components/pricelist/PriceList' import PriceList from '@/components/pricelist/PriceList'
import ManagementNavigation from "@/components/vorstand/ManagementNavigation"; import ManagementNavigation from '@/components/vorstand/ManagementNavigation'
import GastroNavigation from "@/components/gastro/GastroNavigation"; import GastroNavigation from '@/components/gastro/GastroNavigation'
import PriceListView from "@/views/contents/PriceListView"; import PriceListView from '@/views/contents/PriceListView'
import UserManager from "@/components/vorstand/UserManager"; import UserManager from '@/components/vorstand/UserManager'
Vue.use(VueRouter) Vue.use(VueRouter)
const routes = [ const routes = [
{ {
path: '/cookies', path: '/cookies',
name: 'cookies', name: 'cookies'
}, },
{ {
path: '/pricelist', path: '/pricelist',

View File

@ -104,7 +104,6 @@ const mutations = {
amount: data.amount, amount: data.amount,
date: new Date() date: new Date()
}) })
console.log(state.message)
}, },
updateMessage: (state, data) => { updateMessage: (state, data) => {
var message = state.message.find(msg => { var message = state.message.find(msg => {
@ -139,7 +138,7 @@ const actions = {
try { try {
commit('updateUser', { username: data.username, loading: true }) commit('updateUser', { username: data.username, loading: true })
} catch (e) { } catch (e) {
console.log(e) //error
} }
try { try {
const response = await axios.post( const response = await axios.post(
@ -165,14 +164,14 @@ const actions = {
try { try {
commit('updateUser', { username: data.username, loading: false }) commit('updateUser', { username: data.username, loading: false })
} catch (e) { } catch (e) {
console.log(e) //error
} }
}, },
async addCreditList({ commit, rootState, dispatch }, data) { async addCreditList({ commit, rootState, dispatch }, data) {
try { try {
commit('updateUser', { username: data.username, loading: true }) commit('updateUser', { username: data.username, loading: true })
} catch (e) { } catch (e) {
console.log(e) //error
} }
try { try {
const response = await axios.post( const response = await axios.post(
@ -187,17 +186,16 @@ const actions = {
} }
try { try {
commit('updateUser', { username: data.username, loading: false }) commit('updateUser', { username: data.username, loading: false })
} catch (e) { } catch {
console.log(e) //error
} }
}, },
async getAllUsers({ commit, rootState, dispatch }) { async getAllUsers({ commit, rootState, dispatch }) {
commit('setAllUsersLoading', true) commit('setAllUsersLoading', true)
try { try {
const response = await axios.get( const response = await axios.get(url.searchUser, {
url.searchUser, headers: { Token: rootState.login.user.accessToken }
{ headers: { Token: rootState.login.user.accessToken } } })
)
commit('setAllUsers', response.data) commit('setAllUsers', response.data)
} catch (e) { } catch (e) {
if (e.response) if (e.response)

View File

@ -243,13 +243,11 @@ const actions = {
async getAllUsers({ commit, rootState, dispatch }) { async getAllUsers({ commit, rootState, dispatch }) {
commit('setAllUsersLoading', true) commit('setAllUsersLoading', true)
try { try {
const response = await axios.get( const response = await axios.get(url.searchUser, {
url.searchUser, headers: { Token: rootState.login.user.accessToken }
{ headers: { Token: rootState.login.user.accessToken } } })
)
commit('setAllUsers', response.data) commit('setAllUsers', response.data)
} catch (err) { } catch (err) {
// eslint-disable-next-line no-console
if (err.response) if (err.response)
if (err.response.status === 401) if (err.response.status === 401)
dispatch('logout', null, { root: true }) dispatch('logout', null, { root: true })

View File

@ -65,14 +65,10 @@ const mutations = {
deleteTransactJobactJob: (state, data) => { deleteTransactJobactJob: (state, data) => {
const date = new Date(data.year, data.month - 1, data.day) const date = new Date(data.year, data.month - 1, data.day)
var job = state.transactJobs.find(a => { var job = state.transactJobs.find(a => {
console.log(a)
console.log(a.date, date)
return a.date - date === 0 && a.to_user.username === data.username return a.date - date === 0 && a.to_user.username === data.username
}) })
console.log(job)
var index = state.transactJobs.indexOf(job) var index = state.transactJobs.indexOf(job)
if (job) if (job) state.transactJobs.splice(index, 1)
state.transactJobs.splice(index, 1)
} }
} }

View File

@ -204,10 +204,9 @@ const mutations = {
const actions = { const actions = {
async getAllUsers({ commit, rootState, dispatch }) { async getAllUsers({ commit, rootState, dispatch }) {
try { try {
const response = await axios.get( const response = await axios.get(url.searchUser, {
url.searchUser, headers: { Token: rootState.login.user.accessToken }
{ headers: { Token: rootState.login.user.accessToken } } })
)
commit('setAllUsers', { commit('setAllUsers', {
users: response.data, users: response.data,
username: rootState.login.user.username username: rootState.login.user.username
@ -271,7 +270,7 @@ const actions = {
// eslint-disable-next-line no-unused-vars // eslint-disable-next-line no-unused-vars
async deleteJob({ commit, rootState, dispatch }, data) { async deleteJob({ commit, rootState, dispatch }, data) {
try { try {
const response = await axios.post( await axios.post(
url.user.deleteJob, url.user.deleteJob,
{ ...data }, { ...data },
{ headers: { Token: rootState.login.user.accessToken } } { headers: { Token: rootState.login.user.accessToken } }
@ -281,7 +280,6 @@ const actions = {
user: rootState.login.user, user: rootState.login.user,
com: 'delete' com: 'delete'
}) })
console.log(response)
} catch (e) { } catch (e) {
if (e.response) if (e.response)
if (e.response.status === 401) dispatch('logout', null, { root: true }) if (e.response.status === 401) dispatch('logout', null, { root: true })

View File

@ -11,7 +11,9 @@ const state = {
group: null group: null
}, },
loggingIn: false, loggingIn: false,
loginError: null loginError: null,
cookieNotification: true,
cookieAccepted: false
} }
const mutations = { const mutations = {
@ -42,6 +44,12 @@ const mutations = {
state.user.group = null state.user.group = null
state.user.firstname = null state.user.firstname = null
state.user.lastname = null state.user.lastname = null
},
setCookieNotification(state, value) {
state.cookieNotification = value
},
setCookieAccepted(state, value) {
state.cookieAccepted = value
} }
} }
@ -53,6 +61,8 @@ const actions = {
const cookieA = localStorage.getItem('cookie:accepted') const cookieA = localStorage.getItem('cookie:accepted')
if (!cookieA) { if (!cookieA) {
commit('loginStop', 'Sie müssen die Cookies akzeptieren!') commit('loginStop', 'Sie müssen die Cookies akzeptieren!')
commit('setCookieNotification', true)
commit('setCookieAccepted', false)
return return
} }
localStorage.setItem( localStorage.setItem(
@ -93,12 +103,25 @@ const actions = {
logout({ commit }) { logout({ commit }) {
localStorage.removeItem('user') localStorage.removeItem('user')
localStorage.removeItem('cookie:accepted') localStorage.removeItem('cookie:accepted')
localStorage.removeItem('cookie:all') commit('setCookieNotification', true)
commit('setCookieAccepted', false)
commit('logout') commit('logout')
router.push('/login') router.push('/login')
}, },
resetLoginError({ commit }) { resetLoginError({ commit }) {
commit('loginStop') commit('loginStop')
},
acceptNotification({ commit }) {
localStorage.setItem('cookie:accepted', true)
commit('setCookieAccepted', true)
commit('setCookieNotification', false)
},
disableNotification({ commit }) {
commit('setCookieNotification', false)
},
getCookieAccepted({ commit }) {
var cookie = localStorage.getItem('cookie:accepted')
commit('setCookieAccepted', cookie)
} }
} }
@ -158,7 +181,11 @@ const getters = {
}, },
isManagement: state => { isManagement: state => {
try { try {
return state.user.group.includes('vorstand') || state.user.group.includes('gastro') || state.user.group.includes('moneymaster') return (
state.user.group.includes('vorstand') ||
state.user.group.includes('gastro') ||
state.user.group.includes('moneymaster')
)
} catch (e) { } catch (e) {
return false return false
} }
@ -168,6 +195,12 @@ const getters = {
}, },
user: state => { user: state => {
return state.user return state.user
},
cookieNotification: state => {
return state.cookieNotification
},
cookieAccepted: state => {
return state.cookieAccepted
} }
} }

View File

@ -200,10 +200,9 @@ const actions = {
}, },
async getAllUsers({ commit, rootState, dispatch }) { async getAllUsers({ commit, rootState, dispatch }) {
try { try {
const response = await axios.get( const response = await axios.get(url.vorstand.sm.searchUser, {
url.vorstand.sm.searchUser, headers: { Token: rootState.login.user.accessToken }
{ headers: { Token: rootState.login.user.accessToken } } })
)
commit('setAllUsers', response.data) commit('setAllUsers', response.data)
} catch (e) { } catch (e) {
if (e.response) if (e.response)

View File

@ -20,8 +20,6 @@ const mutations = {
state.user = user state.user = user
let list = {} let list = {}
for (let creditList in user['creditList']) { for (let creditList in user['creditList']) {
// eslint-disable-next-line no-console
console.log(creditList)
let amount = mutations.createAmount(user['creditList'][creditList]) let amount = mutations.createAmount(user['creditList'][creditList])
let credit = mutations.createCredit(user['creditList'][creditList]) let credit = mutations.createCredit(user['creditList'][creditList])
let sum = mutations.createSum(credit, amount) let sum = mutations.createSum(credit, amount)
@ -30,8 +28,6 @@ const mutations = {
state.user.creditList = list state.user.creditList = list
state.creditList = [] state.creditList = []
state.error = '' state.error = ''
// eslint-disable-next-line no-console
console.log(state.user)
}, },
createAmount(creditList) { createAmount(creditList) {
let amount = { let amount = {
@ -136,7 +132,6 @@ const mutations = {
}, },
setError(state, value) { setError(state, value) {
state.error = value state.error = value
console.log(state)
}, },
createDays(state, date) { createDays(state, date) {
let days = [] let days = []
@ -194,7 +189,6 @@ const mutations = {
amount: data.amount, amount: data.amount,
date: new Date() date: new Date()
}) })
console.log(state.message)
}, },
updateMessage: (state, data) => { updateMessage: (state, data) => {
var message = state.message.find(msg => { var message = state.message.find(msg => {
@ -230,7 +224,6 @@ const actions = {
{ amount: amount }, { amount: amount },
{ headers: { Token: rootState.login.user.accessToken } } { headers: { Token: rootState.login.user.accessToken } }
) )
console.log(response.data)
commit('setUser', response.data) commit('setUser', response.data)
commit('addMessage', { commit('addMessage', {
user: rootState.login.user, user: rootState.login.user,
@ -257,14 +250,12 @@ const actions = {
{ ...data }, { ...data },
{ headers: { Token: rootState.login.user.accessToken } } { headers: { Token: rootState.login.user.accessToken } }
) )
console.log(response.data)
commit('setUser', response.data) commit('setUser', response.data)
commit('setError', '') commit('setError', '')
} catch (e) { } catch (e) {
if (e.response) { if (e.response) {
if (e.response.status === 401) dispatch('logout', null, { root: true }) if (e.response.status === 401) dispatch('logout', null, { root: true })
if (e.response.data) { if (e.response.data) {
console.log(e.response.data)
commit('setError', e.response.data.error) commit('setError', e.response.data.error)
} }
} }
@ -277,23 +268,19 @@ const actions = {
async updateDay({ commit, rootState, dispatch }, data) { async updateDay({ commit, rootState, dispatch }, data) {
commit('setLoading', true) commit('setLoading', true)
try { try {
console.log('hier bin ich')
const response = await axios.post( const response = await axios.post(
url.user.job, url.user.job,
{ date: data.date.getTime() / 1000 }, { date: data.date.getTime() / 1000 },
{ headers: { Token: rootState.login.user.accessToken } } { headers: { Token: rootState.login.user.accessToken } }
) )
console.log(response.data)
commit('updateDay', { ...response.data, date: data.date }) commit('updateDay', { ...response.data, date: data.date })
} catch (e) { } catch (e) {
if (e.response) { if (e.response) {
if (e.response.status === 401) dispatch('logout', null, { root: true }) if (e.response.status === 401) dispatch('logout', null, { root: true })
if (e.response.data) { if (e.response.data) {
console.log(e.response.data, data.date)
commit('setError', e.response.data.error) commit('setError', e.response.data.error)
} }
} }
console.log(e)
} }
commit('setLoading', false) commit('setLoading', false)
}, },
@ -307,7 +294,6 @@ const actions = {
}, },
{ headers: { Token: rootState.login.user.accessToken } } { headers: { Token: rootState.login.user.accessToken } }
) )
console.log(response.data)
commit('setUser', response.data) commit('setUser', response.data)
commit('updateMessage', { date: data.date, storno: true }) commit('updateMessage', { date: data.date, storno: true })
} catch (e) { } catch (e) {

View File

@ -5,7 +5,7 @@ const state = {
users: [], users: [],
status: [], status: [],
usersLoading: false, usersLoading: false,
statusLoading: false, statusLoading: false
} }
const mutations = { const mutations = {
@ -14,7 +14,6 @@ const mutations = {
}, },
setStatus: (state, status) => { setStatus: (state, status) => {
state.status = status state.status = status
}, },
updateUser: (state, user) => { updateUser: (state, user) => {
let exists = state.users.find(a => { let exists = state.users.find(a => {

View File

@ -1,22 +0,0 @@
<template>
<v-content>
<v-container>
<v-card>
<v-card-title>Informationen zu Cookies</v-card-title>
<v-card-text>
Cookies sind dafür
</v-card-text>
</v-card>
</v-container>
</v-content>
</template>
<script>
export default {
name: "Cookies"
}
</script>
<style scoped>
</style>