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() {
if (!this.spellcheckLoading) {
return 'Rechtschreibung prüfen'
} else {
return 'Wird geprüft...'
}

View File

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

View File

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

View File

@ -81,12 +81,10 @@ export default {
query: ME_QUERY,
fetchPolicy: 'network-only',
}).then(() => that.$router.push('/'));
}
else {
} else {
if (coupon.errors[0].field === 'invalid_coupon') {
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.'];
}
}

View File

@ -1,7 +1,7 @@
<template>
<div class="registration public-page">
<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>
</header>
<form class="registration__form registration-form" novalidate @submit.prevent="validateBeforeSubmit">
@ -220,7 +220,7 @@ export default {
const registrationData = {
customer: {
prefix: this.prefix,
email: this.helloEmail.email,
email: this.helloEmail,
firstname: this.firstname,
lastname: this.lastname,
gender: this.prefix === 'Herr' ? 1 : 2,
@ -298,19 +298,24 @@ export default {
postcodeErrors: [],
registrationError: '',
submitted: false,
helloEmail: {
email: ''
}
helloEmail: ''
};
},
apollo: {
helloEmail: {
query: HELLO_EMAIL,
result({data: {helloEmail}}) {
if (helloEmail.email === '') {
result({data}) {
if (data.helloEmail && data.helloEmail.email === '') {
this.$router.push({name: 'hello'});
}
},
update(data) {
return data.helloEmail.email;
},
error() {
console.log('error')
this.$router.push({name: 'hello'});
}
},
},