Fix helloEmail, make linter happy

This commit is contained in:
Christian Cueni 2020-02-26 12:44:41 +01:00
parent a5e1b323a2
commit 5e77ee0cee
5 changed files with 15 additions and 17 deletions

View File

@ -89,7 +89,6 @@
spellcheckText() { spellcheckText() {
if (!this.spellcheckLoading) { if (!this.spellcheckLoading) {
return 'Rechtschreibung prüfen' return 'Rechtschreibung prüfen'
} else { } else {
return 'Wird geprüft...' return 'Wird geprüft...'
} }

View File

@ -48,7 +48,6 @@ import Logo from '@/components/icons/Logo';
margin-bottom: $large-spacing; margin-bottom: $large-spacing;
} }
&__logo { &__logo {
@include content-block(); @include content-block();
} }
@ -66,6 +65,4 @@ import Logo from '@/components/icons/Logo';
@include content-block(); @include content-block();
} }
} }
</style> </style>

View File

@ -56,8 +56,7 @@ export default {
variables: { variables: {
helloEmail: this.email helloEmail: this.email
} }
}); }).then(() => this.$router.push({name: redirectRouteName, query: this.$route.query}));
this.$router.push({name: redirectRouteName, query: this.$route.query});
}) })
.catch(() => { .catch(() => {
this.registrationError = 'Es ist ein Fehler aufgetreten. Bitte versuchen Sie es nochmals.'; this.registrationError = 'Es ist ein Fehler aufgetreten. Bitte versuchen Sie es nochmals.';

View File

@ -81,12 +81,10 @@ export default {
query: ME_QUERY, query: ME_QUERY,
fetchPolicy: 'network-only', fetchPolicy: 'network-only',
}).then(() => that.$router.push('/')); }).then(() => that.$router.push('/'));
} } else {
else {
if (coupon.errors[0].field === 'invalid_coupon') { if (coupon.errors[0].field === 'invalid_coupon') {
that.couponErrors = ['Der angegebene Coupon-Code ist falsch.']; that.couponErrors = ['Der angegebene Coupon-Code ist falsch.'];
} } else {
else {
that.couponErrors = ['Es ist ein Fehler aufgetreten. Bitte versuchen Sie es nochmals oder kontaktieren Sie den Administrator.']; that.couponErrors = ['Es ist ein Fehler aufgetreten. Bitte versuchen Sie es nochmals oder kontaktieren Sie den Administrator.'];
} }
} }

View File

@ -1,7 +1,7 @@
<template> <template>
<div class="registration public-page"> <div class="registration public-page">
<header class="info-header"> <header class="info-header">
<p class="info-header__text small-emph">Für <span class="info-header__emph">{{helloEmail.email}}</span> haben wir kein Hep Konto gefunden.</p> <p class="info-header__text small-emph">Für <span class="info-header__emph">{{helloEmail}}</span> haben wir kein Hep Konto gefunden.</p>
<h1 class="registration__title public-page__title" data-cy="registration-title">Damit Sie mySkillbox verwenden können, müssen Sie ein Konto erstellen.</h1> <h1 class="registration__title public-page__title" data-cy="registration-title">Damit Sie mySkillbox verwenden können, müssen Sie ein Konto erstellen.</h1>
</header> </header>
<form class="registration__form registration-form" novalidate @submit.prevent="validateBeforeSubmit"> <form class="registration__form registration-form" novalidate @submit.prevent="validateBeforeSubmit">
@ -220,7 +220,7 @@ export default {
const registrationData = { const registrationData = {
customer: { customer: {
prefix: this.prefix, prefix: this.prefix,
email: this.helloEmail.email, email: this.helloEmail,
firstname: this.firstname, firstname: this.firstname,
lastname: this.lastname, lastname: this.lastname,
gender: this.prefix === 'Herr' ? 1 : 2, gender: this.prefix === 'Herr' ? 1 : 2,
@ -298,19 +298,24 @@ export default {
postcodeErrors: [], postcodeErrors: [],
registrationError: '', registrationError: '',
submitted: false, submitted: false,
helloEmail: { helloEmail: ''
email: ''
}
}; };
}, },
apollo: { apollo: {
helloEmail: { helloEmail: {
query: HELLO_EMAIL, query: HELLO_EMAIL,
result({data: {helloEmail}}) { result({data}) {
if (helloEmail.email === '') { if (data.helloEmail && data.helloEmail.email === '') {
this.$router.push({name: 'hello'}); this.$router.push({name: 'hello'});
} }
},
update(data) {
return data.helloEmail.email;
},
error() {
console.log('error')
this.$router.push({name: 'hello'});
} }
}, },
}, },