diff --git a/client/src/pages/license-activation.vue b/client/src/pages/license-activation.vue index d7d6317d..721b87cd 100644 --- a/client/src/pages/license-activation.vue +++ b/client/src/pages/license-activation.vue @@ -129,7 +129,6 @@ export default defineComponent({ return `${field} ist ein Pflichtfeld`; }, validateBeforeSubmit({ coupon: couponCode }) { - console.log('coupon', couponCode); this.submitted = true; this.loading = true; this.$apollo @@ -141,7 +140,7 @@ export default defineComponent({ }, }, update: (store, { data: { coupon } }) => { - if (coupon.success) { + if (coupon.result.__typename == 'Success') { this.couponErrors = []; this.$apollo .query({ @@ -149,17 +148,16 @@ export default defineComponent({ fetchPolicy: 'network-only', }) .then(() => this.$router.push('/')); + } else { + this.couponErrors = ['Der angegebene Coupon-Code ist ungültig.']; } }, }) .catch(({ message }) => { - if (message.indexOf('invalid_coupon') > -1) { - this.couponErrors = ['Der angegebene Coupon-Code ist ungültig.']; - } else { - this.couponErrors = [ - 'Es ist ein Fehler aufgetreten. Bitte versuchen Sie es nochmals oder kontaktieren Sie den Administrator.', - ]; - } + this.couponErrors = [ + 'Es ist ein Fehler aufgetreten. Bitte versuchen Sie es nochmals oder kontaktieren Sie den Administrator.', + ]; + console.error(message); }) .finally(() => { this.loading = false;