remove store redeem and add params code

This commit is contained in:
ogerly 2022-03-21 13:05:31 +01:00
parent bf915a9668
commit 12f2f2845a

View File

@ -118,7 +118,7 @@
{{ messageError }} {{ messageError }}
</span> </span>
</b-alert> </b-alert>
<b-row v-if="$route.params.code"> <b-row v-if="redeemCode">
<b-col> <b-col>
<label>{{ $t('gdd_per_link.redeem') }}</label> <label>{{ $t('gdd_per_link.redeem') }}</label>
<div class="mt-2 mb-2"> <div class="mt-2 mb-2">
@ -130,7 +130,7 @@
readonly readonly
id="redeem-code" id="redeem-code"
type="text" type="text"
v-model="$store.state.redeemCode" v-model="redeemCode"
></b-form-input> ></b-form-input>
</b-input-group> </b-input-group>
</div> </div>
@ -234,7 +234,7 @@ export default {
messageError: '', messageError: '',
register: true, register: true,
publisherId: this.$store.state.publisherId, publisherId: this.$store.state.publisherId,
redeemCode: this.$store.state.redeemCode, redeemCode: this.$route.params.code,
} }
}, },
methods: { methods: {
@ -248,9 +248,6 @@ export default {
commitStorePublisherId(val) { commitStorePublisherId(val) {
this.$store.commit('publisherId', val) this.$store.commit('publisherId', val)
}, },
commitStoreRedeemCode(val) {
this.$store.commit('redeemCode', val)
},
async onSubmit() { async onSubmit() {
this.$apollo this.$apollo
.mutate({ .mutate({
@ -261,7 +258,7 @@ export default {
lastName: this.form.lastname, lastName: this.form.lastname,
language: this.language, language: this.language,
publisherId: this.$store.state.publisherId, publisherId: this.$store.state.publisherId,
redeemCode: this.$store.state.redeemCode, redeemCode: this.redeem,
}, },
}) })
.then(() => { .then(() => {
@ -296,10 +293,5 @@ export default {
return !(this.namesFilled && this.emailFilled && this.form.agree && !!this.language) return !(this.namesFilled && this.emailFilled && this.form.agree && !!this.language)
}, },
}, },
created() {
if (this.$route.params.code) {
this.commitStoreRedeemCode(this.$route.params.code)
}
},
} }
</script> </script>