mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
remove verify login
This commit is contained in:
parent
2d4f7f9fd5
commit
edd2fb992e
@ -52,12 +52,7 @@ import OpenCreationsAmount from '@/components/Contributions/OpenCreationsAmount.
|
|||||||
import ContributionForm from '@/components/Contributions/ContributionForm.vue'
|
import ContributionForm from '@/components/Contributions/ContributionForm.vue'
|
||||||
import ContributionList from '@/components/Contributions/ContributionList.vue'
|
import ContributionList from '@/components/Contributions/ContributionList.vue'
|
||||||
import { createContribution, updateContribution, deleteContribution } from '@/graphql/mutations'
|
import { createContribution, updateContribution, deleteContribution } from '@/graphql/mutations'
|
||||||
import {
|
import { listContributions, listAllContributions, openCreations } from '@/graphql/queries'
|
||||||
listContributions,
|
|
||||||
listAllContributions,
|
|
||||||
verifyLogin,
|
|
||||||
openCreations,
|
|
||||||
} from '@/graphql/queries'
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'Community',
|
name: 'Community',
|
||||||
@ -145,15 +140,19 @@ export default {
|
|||||||
},
|
},
|
||||||
maxGddLastMonth() {
|
maxGddLastMonth() {
|
||||||
// when existing contribution is edited, the amount is added back on top of the amount
|
// when existing contribution is edited, the amount is added back on top of the amount
|
||||||
|
if (this.openCreations && this.openCreations.length)
|
||||||
return this.form.id && !this.isThisMonth
|
return this.form.id && !this.isThisMonth
|
||||||
? parseInt(this.openCreations[1].amount) + parseInt(this.updateAmount)
|
? parseInt(this.openCreations[1].amount) + parseInt(this.updateAmount)
|
||||||
: parseInt(this.openCreations[1].amount)
|
: parseInt(this.openCreations[1].amount)
|
||||||
|
return 0
|
||||||
},
|
},
|
||||||
maxGddThisMonth() {
|
maxGddThisMonth() {
|
||||||
// when existing contribution is edited, the amount is added back on top of the amount
|
// when existing contribution is edited, the amount is added back on top of the amount
|
||||||
|
if (this.openCreations && this.openCreations.length)
|
||||||
return this.form.id && this.isThisMonth
|
return this.form.id && this.isThisMonth
|
||||||
? parseInt(this.openCreations[2].amount) + parseInt(this.updateAmount)
|
? parseInt(this.openCreations[2].amount) + parseInt(this.updateAmount)
|
||||||
: parseInt(this.openCreations[2].amount)
|
: parseInt(this.openCreations[2].amount)
|
||||||
|
return 0
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
@ -183,7 +182,7 @@ export default {
|
|||||||
currentPage: this.currentPage,
|
currentPage: this.currentPage,
|
||||||
pageSize: this.pageSize,
|
pageSize: this.pageSize,
|
||||||
})
|
})
|
||||||
this.verifyLogin()
|
this.$apollo.queries.OpenCreations.refetch()
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
this.toastError(err.message)
|
this.toastError(err.message)
|
||||||
@ -211,7 +210,7 @@ export default {
|
|||||||
currentPage: this.currentPage,
|
currentPage: this.currentPage,
|
||||||
pageSize: this.pageSize,
|
pageSize: this.pageSize,
|
||||||
})
|
})
|
||||||
this.verifyLogin()
|
this.$apollo.queries.OpenCreations.refetch()
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
this.toastError(err.message)
|
this.toastError(err.message)
|
||||||
@ -236,7 +235,7 @@ export default {
|
|||||||
currentPage: this.currentPage,
|
currentPage: this.currentPage,
|
||||||
pageSize: this.pageSize,
|
pageSize: this.pageSize,
|
||||||
})
|
})
|
||||||
this.verifyLogin()
|
this.$apollo.queries.OpenCreations.refetch()
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
this.toastError(err.message)
|
this.toastError(err.message)
|
||||||
@ -291,22 +290,6 @@ export default {
|
|||||||
this.toastError(err.message)
|
this.toastError(err.message)
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
verifyLogin() {
|
|
||||||
this.$apollo
|
|
||||||
.query({
|
|
||||||
query: verifyLogin,
|
|
||||||
fetchPolicy: 'network-only',
|
|
||||||
})
|
|
||||||
.then((result) => {
|
|
||||||
const {
|
|
||||||
data: { verifyLogin },
|
|
||||||
} = result
|
|
||||||
this.$store.dispatch('login', verifyLogin)
|
|
||||||
})
|
|
||||||
.catch(() => {
|
|
||||||
this.$emit('logout')
|
|
||||||
})
|
|
||||||
},
|
|
||||||
updateContributionForm(item) {
|
updateContributionForm(item) {
|
||||||
this.form.id = item.id
|
this.form.id = item.id
|
||||||
this.form.date = item.contributionDate
|
this.form.date = item.contributionDate
|
||||||
@ -326,8 +309,6 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
created() {
|
created() {
|
||||||
// verifyLogin is important at this point so that creation is updated on reload if they are deleted in a session in the admin area.
|
|
||||||
this.verifyLogin()
|
|
||||||
this.updateListContributions({
|
this.updateListContributions({
|
||||||
currentPage: this.currentPage,
|
currentPage: this.currentPage,
|
||||||
pageSize: this.pageSize,
|
pageSize: this.pageSize,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user