Translate success message, guard clause for no Donations

This commit is contained in:
mattwr18 2019-11-12 15:33:21 +01:00
parent 3b5e40efaa
commit 8b5cd48d3c
5 changed files with 15 additions and 5 deletions

View File

@ -17,7 +17,7 @@ export default {
}, },
data() { data() {
return { return {
goal: 0, goal: 15000,
progress: 0, progress: 0,
} }
}, },
@ -39,7 +39,8 @@ export default {
query() { query() {
return DonationsQuery() return DonationsQuery()
}, },
result({ data: { Donations } }) { update({ Donations }) {
if (!Donations[0]) return
const { goal, progress } = Donations[0] const { goal, progress } = Donations[0]
this.goal = goal this.goal = goal
this.progress = progress this.progress = progress

View File

@ -384,7 +384,8 @@
"donations": { "donations": {
"name": "Spendeninfo", "name": "Spendeninfo",
"goal": "Monatlich benötigte Spenden", "goal": "Monatlich benötigte Spenden",
"progress": "Bereits gesammelte Spenden" "progress": "Bereits gesammelte Spenden",
"successfulUpdate": "Spenden-Info erfolgreich aktualisiert!"
} }
}, },
"post": { "post": {

View File

@ -385,7 +385,8 @@
"donations": { "donations": {
"name": "Donations info", "name": "Donations info",
"goal": "Monthly donations needed", "goal": "Monthly donations needed",
"progress": "Donations collected so far" "progress": "Donations collected so far",
"successfulUpdate": "Donations info updated successfully!"
} }
}, },
"post": { "post": {

View File

@ -380,6 +380,12 @@
"name": "Convidar usuários", "name": "Convidar usuários",
"title": "Convidar pessoas", "title": "Convidar pessoas",
"description": "Convites são uma maneira maravilhosa de ter seus amigos em sua rede …" "description": "Convites são uma maneira maravilhosa de ter seus amigos em sua rede …"
},
"donations": {
"name": "Informações sobre Doações",
"goal": "Doações mensais necessárias",
"progress": "Doações arrecadadas até o momento",
"successfulUpdate": "Informações sobre doações atualizadas com sucesso!"
} }
}, },
"post": { "post": {

View File

@ -39,7 +39,7 @@ export default {
}, },
}) })
.then(() => { .then(() => {
this.$toast.success('yay!!') this.$toast.success(this.$t('admin.donations.successfulUpdate'))
}) })
.catch(error => this.$toast.error(error.message)) .catch(error => this.$toast.error(error.message))
}, },
@ -50,6 +50,7 @@ export default {
return DonationsQuery() return DonationsQuery()
}, },
update({ Donations }) { update({ Donations }) {
if (!Donations[0]) return
const { goal, progress } = Donations[0] const { goal, progress } = Donations[0]
this.formData = { this.formData = {
goal, goal,