From 6829d7eeac634f3ab725d739705bc18739950a07 Mon Sep 17 00:00:00 2001 From: ogerly Date: Sun, 20 Mar 2022 11:40:11 +0100 Subject: [PATCH] add method redeemLink, add text that shows the code in the formular --- frontend/src/pages/Login.vue | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/frontend/src/pages/Login.vue b/frontend/src/pages/Login.vue index 9d33678f5..5c3e52521 100755 --- a/frontend/src/pages/Login.vue +++ b/frontend/src/pages/Login.vue @@ -42,6 +42,10 @@ +
+ {{ $t('gdd_per_link.redeem') + ':' }} + {{ $route.params.code }} +
@@ -64,6 +68,7 @@ import InputPassword from '@/components/Inputs/InputPassword' import InputEmail from '@/components/Inputs/InputEmail' import { login } from '@/graphql/queries' import { getCommunityInfoMixin } from '@/mixins/getCommunityInfo' +import { redeemTransactionLink } from '@/graphql/mutations' export default { name: 'Login', @@ -101,7 +106,12 @@ export default { data: { login }, } = result this.$store.dispatch('login', login) + if (this.$route.params.code) { + this.redeemLink(this.$route.params.code) + } + this.$router.push('/overview') + loader.hide() }) .catch((error) => { @@ -114,6 +124,21 @@ export default { loader.hide() }) }, + redeemLink(code) { + this.$apollo + .mutate({ + mutation: redeemTransactionLink, + variables: { + code: code, + }, + }) + .then(() => { + this.toastSuccess(this.$t('gdd_per_link.successfully-redeemed')) + }) + .catch((err) => { + this.toastError(err.message) + }) + }, }, }