add search for baruser
TODO: maybe we can change the filter in finanzerview too
This commit is contained in:
parent
1bd0d87034
commit
708f40938a
|
@ -1,10 +1,13 @@
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<div v-for="user in users" :key="users.indexOf(user)">
|
<div v-for="user in users" :key="users.indexOf(user)">
|
||||||
|
<div v-if="isFiltered(user)">
|
||||||
<v-container>
|
<v-container>
|
||||||
<v-card>
|
<v-card>
|
||||||
<v-list-item>
|
<v-list-item>
|
||||||
<v-list-item-title class="title">{{user.firstname}} {{user.lastname}}</v-list-item-title>
|
<v-list-item-title class="title"
|
||||||
|
>{{ user.firstname }} {{ user.lastname }}</v-list-item-title
|
||||||
|
>
|
||||||
</v-list-item>
|
</v-list-item>
|
||||||
<v-card-text>
|
<v-card-text>
|
||||||
<v-row>
|
<v-row>
|
||||||
|
@ -14,28 +17,37 @@
|
||||||
<v-btn
|
<v-btn
|
||||||
class="creditBtn"
|
class="creditBtn"
|
||||||
block
|
block
|
||||||
@click="addAmount({username: user.username, amount: 200})"
|
@click="
|
||||||
|
addAmount({ username: user.username, amount: 200 })
|
||||||
|
"
|
||||||
:color="color"
|
:color="color"
|
||||||
:disabled="user.locked"
|
:disabled="user.locked"
|
||||||
>2 €</v-btn>
|
>2 €</v-btn
|
||||||
|
>
|
||||||
</v-col>
|
</v-col>
|
||||||
<v-col>
|
<v-col>
|
||||||
<v-btn
|
<v-btn
|
||||||
class="creditBtn"
|
class="creditBtn"
|
||||||
block
|
block
|
||||||
@click="addAmount({username: user.username, amount: 100})"
|
@click="
|
||||||
|
addAmount({ username: user.username, amount: 100 })
|
||||||
|
"
|
||||||
:color="color"
|
:color="color"
|
||||||
:disabled="user.locked"
|
:disabled="user.locked"
|
||||||
>1 €</v-btn>
|
>1 €</v-btn
|
||||||
|
>
|
||||||
</v-col>
|
</v-col>
|
||||||
<v-col>
|
<v-col>
|
||||||
<v-btn
|
<v-btn
|
||||||
class="creditBtn"
|
class="creditBtn"
|
||||||
block
|
block
|
||||||
@click="addAmount({username: user.username, amount: 50})"
|
@click="
|
||||||
|
addAmount({ username: user.username, amount: 50 })
|
||||||
|
"
|
||||||
:color="color"
|
:color="color"
|
||||||
:disabled="user.locked"
|
:disabled="user.locked"
|
||||||
>0,50 €</v-btn>
|
>0,50 €</v-btn
|
||||||
|
>
|
||||||
</v-col>
|
</v-col>
|
||||||
</v-row>
|
</v-row>
|
||||||
<v-row>
|
<v-row>
|
||||||
|
@ -43,50 +55,64 @@
|
||||||
<v-btn
|
<v-btn
|
||||||
class="creditBtn"
|
class="creditBtn"
|
||||||
block
|
block
|
||||||
@click="addAmount({username:user.username, amount: 40})"
|
@click="
|
||||||
|
addAmount({ username: user.username, amount: 40 })
|
||||||
|
"
|
||||||
:color="color"
|
:color="color"
|
||||||
:disabled="user.locked"
|
:disabled="user.locked"
|
||||||
>0,40 €</v-btn>
|
>0,40 €</v-btn
|
||||||
|
>
|
||||||
</v-col>
|
</v-col>
|
||||||
<v-col>
|
<v-col>
|
||||||
<v-btn
|
<v-btn
|
||||||
class="creditBtn"
|
class="creditBtn"
|
||||||
block
|
block
|
||||||
@click="addAmount({username: user.username, amount: 20})"
|
@click="
|
||||||
|
addAmount({ username: user.username, amount: 20 })
|
||||||
|
"
|
||||||
:color="color"
|
:color="color"
|
||||||
:disabled="user.locked"
|
:disabled="user.locked"
|
||||||
>0,20 €</v-btn>
|
>0,20 €</v-btn
|
||||||
|
>
|
||||||
</v-col>
|
</v-col>
|
||||||
<v-col>
|
<v-col>
|
||||||
<v-btn
|
<v-btn
|
||||||
class="creditBtn"
|
class="creditBtn"
|
||||||
block
|
block
|
||||||
@click="addAmount({username: user.username, amount: 10})"
|
@click="
|
||||||
|
addAmount({ username: user.username, amount: 10 })
|
||||||
|
"
|
||||||
:color="color"
|
:color="color"
|
||||||
:disabled="user.locked"
|
:disabled="user.locked"
|
||||||
>0,10 €</v-btn>
|
>0,10 €</v-btn
|
||||||
|
>
|
||||||
</v-col>
|
</v-col>
|
||||||
</v-row>
|
</v-row>
|
||||||
</v-col>
|
</v-col>
|
||||||
<v-col align-self="center">
|
<v-col align-self="center">
|
||||||
<v-row>
|
<v-row>
|
||||||
<v-list-item>
|
<v-list-item>
|
||||||
<v-list-item-action-text
|
<v-list-item-action-text :class="getColor(user.type)"
|
||||||
:class="getColor(user.type)"
|
>{{
|
||||||
>{{(user.amount/100).toFixed(2)}} €</v-list-item-action-text>
|
(user.amount / 100).toFixed(2)
|
||||||
|
}}
|
||||||
|
€</v-list-item-action-text
|
||||||
|
>
|
||||||
</v-list-item>
|
</v-list-item>
|
||||||
</v-row>
|
</v-row>
|
||||||
</v-col>
|
</v-col>
|
||||||
</v-row>
|
</v-row>
|
||||||
<v-alert
|
<v-alert v-if="user.locked" type="error"
|
||||||
v-if="user.locked"
|
>{{ user.firstname }} darf nicht mehr anschreiben.
|
||||||
type="error"
|
{{ user.firstname }} sollte sich lieber mal beim Finanzer
|
||||||
>{{user.firstname}} darf nicht mehr anschreiben. {{user.firstname}} sollte sich lieber mal beim Finanzer melden.</v-alert>
|
melden.</v-alert
|
||||||
|
>
|
||||||
</v-card-text>
|
</v-card-text>
|
||||||
</v-card>
|
</v-card>
|
||||||
</v-container>
|
</v-container>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
@ -102,8 +128,6 @@ export default {
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.getUsers()
|
this.getUsers()
|
||||||
// eslint-disable-next-line no-console
|
|
||||||
console.log(this.users)
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
...mapActions({
|
...mapActions({
|
||||||
|
@ -112,10 +136,23 @@ export default {
|
||||||
}),
|
}),
|
||||||
getColor(type) {
|
getColor(type) {
|
||||||
return type === 'credit' ? 'title green--text' : 'title red--text'
|
return type === 'credit' ? 'title green--text' : 'title red--text'
|
||||||
|
},
|
||||||
|
isFiltered(user) {
|
||||||
|
try {
|
||||||
|
return (
|
||||||
|
user.firstname.toLowerCase().includes(this.filter.toLowerCase()) ||
|
||||||
|
user.lastname.toLowerCase().includes(this.filter.toLowerCase())
|
||||||
|
)
|
||||||
|
} catch (e) {
|
||||||
|
return true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...mapGetters({ users: 'barUsers/users' })
|
...mapGetters({
|
||||||
|
users: 'barUsers/users',
|
||||||
|
filter: 'barUsers/filter'
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -13,6 +13,7 @@
|
||||||
item-text="fullName"
|
item-text="fullName"
|
||||||
prepend-inner-icon="search"
|
prepend-inner-icon="search"
|
||||||
full-width
|
full-width
|
||||||
|
:search-input.sync="filter"
|
||||||
/>
|
/>
|
||||||
<v-btn text @click="addUser">Hinzufügen</v-btn>
|
<v-btn text @click="addUser">Hinzufügen</v-btn>
|
||||||
</v-toolbar-items>
|
</v-toolbar-items>
|
||||||
|
@ -28,7 +29,8 @@ export default {
|
||||||
props: {},
|
props: {},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
user: null
|
user: null,
|
||||||
|
filter: ''
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
|
@ -37,7 +39,8 @@ export default {
|
||||||
methods: {
|
methods: {
|
||||||
...mapActions({
|
...mapActions({
|
||||||
getAllUsers: 'barUsers/getAllUsers',
|
getAllUsers: 'barUsers/getAllUsers',
|
||||||
addCreditList: 'barUsers/addCreditList'
|
addCreditList: 'barUsers/addCreditList',
|
||||||
|
setFilter: 'barUsers/setFilter'
|
||||||
}),
|
}),
|
||||||
addUser() {
|
addUser() {
|
||||||
this.addCreditList(this.user)
|
this.addCreditList(this.user)
|
||||||
|
@ -46,9 +49,13 @@ export default {
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...mapGetters({ allUsers: 'barUsers/allUsers' })
|
...mapGetters({ allUsers: 'barUsers/allUsers' })
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
filter(val) {
|
||||||
|
this.setFilter(val)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped></style>
|
||||||
</style>
|
|
||||||
|
|
|
@ -17,7 +17,12 @@
|
||||||
<v-spacer />
|
<v-spacer />
|
||||||
<v-toolbar-items>
|
<v-toolbar-items>
|
||||||
<v-btn text @click="sendMails">Emails senden</v-btn>
|
<v-btn text @click="sendMails">Emails senden</v-btn>
|
||||||
<v-text-field v-model="filter" style="margin-top: 3px" append-icon="search" outlined></v-text-field>
|
<v-text-field
|
||||||
|
v-model="filter"
|
||||||
|
style="margin-top: 3px"
|
||||||
|
append-icon="search"
|
||||||
|
outlined
|
||||||
|
></v-text-field>
|
||||||
</v-toolbar-items>
|
</v-toolbar-items>
|
||||||
</v-toolbar>
|
</v-toolbar>
|
||||||
<v-expand-transition>
|
<v-expand-transition>
|
||||||
|
@ -28,7 +33,7 @@
|
||||||
text
|
text
|
||||||
icon
|
icon
|
||||||
style="margin-right: 5px"
|
style="margin-right: 5px"
|
||||||
@click="errorExpand ? errorExpand = false : errorExpand = true"
|
@click="errorExpand ? (errorExpand = false) : (errorExpand = true)"
|
||||||
>
|
>
|
||||||
<v-icon :class="isExpand(errorExpand)" dense>$expand</v-icon>
|
<v-icon :class="isExpand(errorExpand)" dense>$expand</v-icon>
|
||||||
</v-btn>
|
</v-btn>
|
||||||
|
@ -40,13 +45,17 @@
|
||||||
:key="errorMails.indexOf(error)"
|
:key="errorMails.indexOf(error)"
|
||||||
dense
|
dense
|
||||||
:type="computeError(error.error)"
|
:type="computeError(error.error)"
|
||||||
>{{errorMessage(error)}}</v-alert>
|
>{{ errorMessage(error) }}</v-alert
|
||||||
|
>
|
||||||
</div>
|
</div>
|
||||||
</v-expand-transition>
|
</v-expand-transition>
|
||||||
</v-card>
|
</v-card>
|
||||||
</v-expand-transition>
|
</v-expand-transition>
|
||||||
<div v-for="user in users" :key="users.indexOf(user)">
|
<div v-for="user in users" :key="users.indexOf(user)">
|
||||||
<v-card v-if="user.creditList[year] && isFiltered(user)" style="margin-top: 3px">
|
<v-card
|
||||||
|
v-if="user.creditList[year] && isFiltered(user)"
|
||||||
|
style="margin-top: 3px"
|
||||||
|
>
|
||||||
<v-card-title>{{ user.lastname }}, {{ user.firstname }}</v-card-title>
|
<v-card-title>{{ user.lastname }}, {{ user.firstname }}</v-card-title>
|
||||||
<Table v-bind:user="user" v-bind:year="year" />
|
<Table v-bind:user="user" v-bind:year="year" />
|
||||||
<v-container fluid>
|
<v-container fluid>
|
||||||
|
@ -60,7 +69,10 @@
|
||||||
<v-chip
|
<v-chip
|
||||||
outlined
|
outlined
|
||||||
:text-color="getLastColor(user.creditList[year][1].last)"
|
:text-color="getLastColor(user.creditList[year][1].last)"
|
||||||
>{{(user.creditList[year][1].last / 100).toFixed(2)}}</v-chip>
|
>{{
|
||||||
|
(user.creditList[year][1].last / 100).toFixed(2)
|
||||||
|
}}</v-chip
|
||||||
|
>
|
||||||
</v-col>
|
</v-col>
|
||||||
</v-row>
|
</v-row>
|
||||||
<v-row>
|
<v-row>
|
||||||
|
@ -71,10 +83,23 @@
|
||||||
<v-chip
|
<v-chip
|
||||||
outlined
|
outlined
|
||||||
x-large
|
x-large
|
||||||
:text-color="getLastColor(getAllSum(user.creditList[year][2].sum ,user.creditList[year][1].last))"
|
:text-color="
|
||||||
|
getLastColor(
|
||||||
|
getAllSum(
|
||||||
|
user.creditList[year][2].sum,
|
||||||
|
user.creditList[year][1].last
|
||||||
|
)
|
||||||
|
)
|
||||||
|
"
|
||||||
>
|
>
|
||||||
{{(getAllSum(user.creditList[year][2].sum ,user.creditList[year][1].last) /
|
{{
|
||||||
100).toFixed(2)}}
|
(
|
||||||
|
getAllSum(
|
||||||
|
user.creditList[year][2].sum,
|
||||||
|
user.creditList[year][1].last
|
||||||
|
) / 100
|
||||||
|
).toFixed(2)
|
||||||
|
}}
|
||||||
</v-chip>
|
</v-chip>
|
||||||
</v-col>
|
</v-col>
|
||||||
</v-row>
|
</v-row>
|
||||||
|
@ -85,18 +110,26 @@
|
||||||
<v-label>Status:</v-label>
|
<v-label>Status:</v-label>
|
||||||
</v-col>
|
</v-col>
|
||||||
<v-col>
|
<v-col>
|
||||||
<v-chip
|
<v-chip outlined :text-color="getLockedColor(user.locked)">{{
|
||||||
outlined
|
user.locked ? 'Gesperrt' : 'nicht Gesperrt'
|
||||||
:text-color="getLockedColor(user.locked)"
|
}}</v-chip>
|
||||||
>{{user.locked ? 'Gesperrt': 'nicht Gesperrt'}}</v-chip>
|
|
||||||
</v-col>
|
</v-col>
|
||||||
</v-row>
|
</v-row>
|
||||||
<v-card outlined>
|
<v-card outlined>
|
||||||
<v-row>
|
<v-row>
|
||||||
<v-card-title class="subtitle-2">Geld transferieren</v-card-title>
|
<v-card-title class="subtitle-2"
|
||||||
|
>Geld transferieren</v-card-title
|
||||||
|
>
|
||||||
<v-spacer />
|
<v-spacer />
|
||||||
<v-btn text icon style="margin-right: 5px" @click="setExpand(user)">
|
<v-btn
|
||||||
<v-icon :class="isExpand(user.expand)" dense>$expand</v-icon>
|
text
|
||||||
|
icon
|
||||||
|
style="margin-right: 5px"
|
||||||
|
@click="setExpand(user)"
|
||||||
|
>
|
||||||
|
<v-icon :class="isExpand(user.expand)" dense
|
||||||
|
>$expand</v-icon
|
||||||
|
>
|
||||||
</v-btn>
|
</v-btn>
|
||||||
</v-row>
|
</v-row>
|
||||||
<v-expand-transition>
|
<v-expand-transition>
|
||||||
|
@ -104,14 +137,21 @@
|
||||||
<v-form style="margin-left: 15px; margin-right: 15px">
|
<v-form style="margin-left: 15px; margin-right: 15px">
|
||||||
<v-row>
|
<v-row>
|
||||||
<v-col>
|
<v-col>
|
||||||
<v-text-field :rules="[isNumber]" label="Betrag" v-model="amount"></v-text-field>
|
<v-text-field
|
||||||
|
:rules="[isNumber]"
|
||||||
|
label="Betrag"
|
||||||
|
v-model="amount"
|
||||||
|
></v-text-field>
|
||||||
</v-col>
|
</v-col>
|
||||||
<v-col>
|
<v-col>
|
||||||
<v-select
|
<v-select
|
||||||
return-object
|
return-object
|
||||||
v-model="type"
|
v-model="type"
|
||||||
label="Typ"
|
label="Typ"
|
||||||
:items="[{value: 'amount', text: 'Schulden'}, {value: 'credit', text: 'Guthaben'}]"
|
:items="[
|
||||||
|
{ value: 'amount', text: 'Schulden' },
|
||||||
|
{ value: 'credit', text: 'Guthaben' }
|
||||||
|
]"
|
||||||
item-text="text"
|
item-text="text"
|
||||||
item-value="value"
|
item-value="value"
|
||||||
></v-select>
|
></v-select>
|
||||||
|
@ -191,10 +231,7 @@ export default {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {},
|
||||||
// eslint-disable-next-line no-console
|
|
||||||
console.log(this.getData(this.createYears()))
|
|
||||||
},
|
|
||||||
methods: {
|
methods: {
|
||||||
...mapActions({
|
...mapActions({
|
||||||
createYears: 'finanzerUsers/createYears',
|
createYears: 'finanzerUsers/createYears',
|
||||||
|
|
|
@ -3,7 +3,8 @@ import url from '@/plugins/routes'
|
||||||
|
|
||||||
const state = {
|
const state = {
|
||||||
users: [],
|
users: [],
|
||||||
allUsers: []
|
allUsers: [],
|
||||||
|
filter: ''
|
||||||
}
|
}
|
||||||
|
|
||||||
const mutations = {
|
const mutations = {
|
||||||
|
@ -16,11 +17,7 @@ const mutations = {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
setUsers: (state, users) => {
|
setUsers: (state, users) => {
|
||||||
// eslint-disable-next-line no-console
|
|
||||||
console.log(users)
|
|
||||||
for (let user in users) {
|
for (let user in users) {
|
||||||
// eslint-disable-next-line no-console
|
|
||||||
console.log(user)
|
|
||||||
let existuser = state.users.find(a => {
|
let existuser = state.users.find(a => {
|
||||||
return user === a.username
|
return user === a.username
|
||||||
})
|
})
|
||||||
|
@ -43,8 +40,6 @@ const mutations = {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// eslint-disable-next-line no-console
|
|
||||||
console.log(state.users)
|
|
||||||
mutations.sortUsers(state)
|
mutations.sortUsers(state)
|
||||||
},
|
},
|
||||||
sortUsers: state => {
|
sortUsers: state => {
|
||||||
|
@ -55,6 +50,9 @@ const mutations = {
|
||||||
if (a.firstname < b.firstname) return -1
|
if (a.firstname < b.firstname) return -1
|
||||||
return 0
|
return 0
|
||||||
})
|
})
|
||||||
|
},
|
||||||
|
setFilter: (state, filter) => {
|
||||||
|
state.filter = filter
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -65,8 +63,6 @@ const actions = {
|
||||||
const response = await axios.get(url.bar, {
|
const response = await axios.get(url.bar, {
|
||||||
headers: { Token: rootState.login.user.accessToken }
|
headers: { Token: rootState.login.user.accessToken }
|
||||||
})
|
})
|
||||||
// eslint-disable-next-line no-console
|
|
||||||
console.log(response.data)
|
|
||||||
commit('setUsers', response.data)
|
commit('setUsers', response.data)
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
if (e.response)
|
if (e.response)
|
||||||
|
@ -100,23 +96,20 @@ const actions = {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
async getAllUsers({ commit, rootState, dispatch }) {
|
async getAllUsers({ commit, rootState, dispatch }) {
|
||||||
// eslint-disable-next-line no-console
|
|
||||||
console.log('hier bin ich')
|
|
||||||
try {
|
try {
|
||||||
const response = await axios.post(
|
const response = await axios.post(
|
||||||
url.searchUser,
|
url.searchUser,
|
||||||
{ searchString: '' },
|
{ searchString: '' },
|
||||||
{ headers: { Token: rootState.login.user.accessToken } }
|
{ headers: { Token: rootState.login.user.accessToken } }
|
||||||
)
|
)
|
||||||
// eslint-disable-next-line no-console
|
|
||||||
console.log(response)
|
|
||||||
commit('setAllUsers', response.data)
|
commit('setAllUsers', response.data)
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
// eslint-disable-next-line no-console
|
|
||||||
console.log(e)
|
|
||||||
if (e.response)
|
if (e.response)
|
||||||
if (e.response.data === 401) dispatch('logout', null, { root: true })
|
if (e.response.data === 401) dispatch('logout', null, { root: true })
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
setFilter({ commit }, data) {
|
||||||
|
commit('setFilter', data)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -126,6 +119,9 @@ const getters = {
|
||||||
},
|
},
|
||||||
allUsers: state => {
|
allUsers: state => {
|
||||||
return state.allUsers
|
return state.allUsers
|
||||||
|
},
|
||||||
|
filter: state => {
|
||||||
|
return state.filter
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -47,11 +47,7 @@ const mutations = {
|
||||||
state.errorMail = null
|
state.errorMail = null
|
||||||
},
|
},
|
||||||
setUsers: (state, users) => {
|
setUsers: (state, users) => {
|
||||||
// eslint-disable-next-line no-console
|
|
||||||
console.log('users', users)
|
|
||||||
for (let user in users) {
|
for (let user in users) {
|
||||||
// eslint-disable-next-line no-console
|
|
||||||
console.log('user', user)
|
|
||||||
let list = {}
|
let list = {}
|
||||||
for (let creditList in users[user]['creditList']) {
|
for (let creditList in users[user]['creditList']) {
|
||||||
let amount = mutations.createAmount(
|
let amount = mutations.createAmount(
|
||||||
|
@ -67,9 +63,6 @@ const mutations = {
|
||||||
let existUser = state.users.find(a => {
|
let existUser = state.users.find(a => {
|
||||||
return a.username === user
|
return a.username === user
|
||||||
})
|
})
|
||||||
|
|
||||||
// eslint-disable-next-line no-console
|
|
||||||
console.log(existUser)
|
|
||||||
if (existUser) {
|
if (existUser) {
|
||||||
existUser.username = users[user].username
|
existUser.username = users[user].username
|
||||||
existUser.firstname = users[user].firstname
|
existUser.firstname = users[user].firstname
|
||||||
|
@ -92,9 +85,6 @@ const mutations = {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
mutations.sortUsers(state)
|
mutations.sortUsers(state)
|
||||||
|
|
||||||
// eslint-disable-next-line no-console
|
|
||||||
console.log(state.users)
|
|
||||||
},
|
},
|
||||||
createAmount(creditList) {
|
createAmount(creditList) {
|
||||||
let amount = {
|
let amount = {
|
||||||
|
@ -240,8 +230,6 @@ const mutations = {
|
||||||
const actions = {
|
const actions = {
|
||||||
// eslint-disable-next-line no-unused-vars
|
// eslint-disable-next-line no-unused-vars
|
||||||
async getAllUsers({ commit, rootState, dispatch }) {
|
async getAllUsers({ commit, rootState, dispatch }) {
|
||||||
// eslint-disable-next-line no-console
|
|
||||||
console.log(rootState)
|
|
||||||
try {
|
try {
|
||||||
const response = await axios.post(
|
const response = await axios.post(
|
||||||
url.searchUser,
|
url.searchUser,
|
||||||
|
@ -261,12 +249,8 @@ const actions = {
|
||||||
const response = await axios.get(url.getFinanzerMain, {
|
const response = await axios.get(url.getFinanzerMain, {
|
||||||
headers: { Token: rootState.login.user.accessToken }
|
headers: { Token: rootState.login.user.accessToken }
|
||||||
})
|
})
|
||||||
// eslint-disable-next-line no-console
|
|
||||||
console.log('response', response.data)
|
|
||||||
commit('setUsers', response.data)
|
commit('setUsers', response.data)
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
// eslint-disable-next-line no-console
|
|
||||||
console.log(err)
|
|
||||||
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 })
|
||||||
|
|
Loading…
Reference in New Issue