Withdrew the loginAPI call and replaced it with the Apollo sendEmail query.

This commit is contained in:
Hannes Heine 2021-08-10 13:47:31 +02:00
parent 61a1647f63
commit bd1889295d

View File

@ -38,7 +38,7 @@
</div> </div>
</template> </template>
<script> <script>
import loginAPI from '../../apis/loginAPI.js' import { sendEmail } from '../../graphql/queries'
import InputEmail from '../../components/Inputs/InputEmail' import InputEmail from '../../components/Inputs/InputEmail'
export default { export default {
@ -56,9 +56,15 @@ export default {
}, },
methods: { methods: {
async onSubmit() { async onSubmit() {
await loginAPI.sendEmail(this.form.email) this.$apollo
// always give success to avoid email spying .query({
this.$router.push('/thx/password') query: sendEmail,
variables: {
email: this.form.email,
},
})
.then(() => this.$router.push('/thx/password'))
.error(() => this.$router.push('/thx/password'))
}, },
}, },
} }