mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
add methodes to update hide amounts
This commit is contained in:
parent
ae5c5984b8
commit
b139834729
@ -39,7 +39,7 @@
|
|||||||
<b-icon
|
<b-icon
|
||||||
:icon="hideAmount ? 'eye-slash' : 'eye'"
|
:icon="hideAmount ? 'eye-slash' : 'eye'"
|
||||||
class="mr-3 gradido-global-border-color-accent pointer hover-icon"
|
class="mr-3 gradido-global-border-color-accent pointer hover-icon"
|
||||||
@click="$store.commit('hideAmountGDD', !hideAmount)"
|
@click="updateHideAmountGDD"
|
||||||
></b-icon>
|
></b-icon>
|
||||||
</b-col>
|
</b-col>
|
||||||
</b-row>
|
</b-row>
|
||||||
@ -47,6 +47,8 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
|
import { updateUserInfos } from '@/graphql/mutations'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'GddAmount',
|
name: 'GddAmount',
|
||||||
props: {
|
props: {
|
||||||
@ -60,5 +62,27 @@ export default {
|
|||||||
return this.$store.state.hideAmountGDD
|
return this.$store.state.hideAmountGDD
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
methods: {
|
||||||
|
async updateHideAmountGDD() {
|
||||||
|
this.$apollo
|
||||||
|
.mutate({
|
||||||
|
mutation: updateUserInfos,
|
||||||
|
variables: {
|
||||||
|
hideAmountGDD: !this.hideAmount,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
.then(() => {
|
||||||
|
this.$store.commit('hideAmountGDD', !this.hideAmount)
|
||||||
|
if (!this.hideAmount) {
|
||||||
|
this.toastSuccess(this.$t('settings.showAmountGDD'))
|
||||||
|
} else {
|
||||||
|
this.toastSuccess(this.$t('settings.hideAmountGDD'))
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch((error) => {
|
||||||
|
this.toastError(error.message)
|
||||||
|
})
|
||||||
|
},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@ -34,7 +34,7 @@
|
|||||||
<b-icon
|
<b-icon
|
||||||
:icon="hideAmount ? 'eye-slash' : 'eye'"
|
:icon="hideAmount ? 'eye-slash' : 'eye'"
|
||||||
class="mr-3 gradido-global-border-color-accent pointer hover-icon"
|
class="mr-3 gradido-global-border-color-accent pointer hover-icon"
|
||||||
@click="$store.commit('hideAmountGDT', !hideAmount)"
|
@click="updateHideAmountGDT"
|
||||||
></b-icon>
|
></b-icon>
|
||||||
</b-col>
|
</b-col>
|
||||||
</b-row>
|
</b-row>
|
||||||
@ -42,6 +42,8 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
|
import { updateUserInfos } from '@/graphql/mutations'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'GdtAmount',
|
name: 'GdtAmount',
|
||||||
props: {
|
props: {
|
||||||
@ -54,5 +56,27 @@ export default {
|
|||||||
return this.$store.state.hideAmountGDT
|
return this.$store.state.hideAmountGDT
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
methods: {
|
||||||
|
async updateHideAmountGDT() {
|
||||||
|
this.$apollo
|
||||||
|
.mutate({
|
||||||
|
mutation: updateUserInfos,
|
||||||
|
variables: {
|
||||||
|
hideAmountGDT: !this.hideAmount,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
.then(() => {
|
||||||
|
this.$store.commit('hideAmountGDT', !this.hideAmount)
|
||||||
|
if (!this.hideAmount) {
|
||||||
|
this.toastSuccess(this.$t('settings.showAmountGDT'))
|
||||||
|
} else {
|
||||||
|
this.toastSuccess(this.$t('settings.hideAmountGDT'))
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch((error) => {
|
||||||
|
this.toastError(error.message)
|
||||||
|
})
|
||||||
|
},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@ -31,8 +31,8 @@ export const updateUserInfos = gql`
|
|||||||
$password: String
|
$password: String
|
||||||
$passwordNew: String
|
$passwordNew: String
|
||||||
$locale: String
|
$locale: String
|
||||||
$hideAmountGDD: boolean!
|
$hideAmountGDD: Boolean
|
||||||
$hideAmountGDT: boolean!
|
$hideAmountGDT: Boolean
|
||||||
) {
|
) {
|
||||||
updateUserInfos(
|
updateUserInfos(
|
||||||
firstName: $firstName
|
firstName: $firstName
|
||||||
|
|||||||
@ -269,6 +269,10 @@
|
|||||||
"warningText": "Bist du noch da?"
|
"warningText": "Bist du noch da?"
|
||||||
},
|
},
|
||||||
"settings": {
|
"settings": {
|
||||||
|
"showAmountGDD": "Dein GDD Betrag ist sichtbar.",
|
||||||
|
"hideAmountGDD": "Dein GDD Betrag ist versteckt.",
|
||||||
|
"showAmountGDT": "Dein GDT Betrag ist sichtbar.",
|
||||||
|
"hideAmountGDT": "Dein GDT Betrag ist versteckt.",
|
||||||
"language": {
|
"language": {
|
||||||
"changeLanguage": "Sprache ändern",
|
"changeLanguage": "Sprache ändern",
|
||||||
"de": "Deutsch",
|
"de": "Deutsch",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user