mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-12 23:35:58 +00:00
Follow @mattwr18 suggetions don't enter mail twice
This commit is contained in:
parent
9dd340c69b
commit
ff46740e90
@ -69,7 +69,7 @@ describe('Request', () => {
|
||||
beforeEach(jest.runAllTimers)
|
||||
|
||||
it('emits `handleSubmitted`', () => {
|
||||
expect(wrapper.emitted('handleSubmitted')).toBeTruthy()
|
||||
expect(wrapper.emitted('handleSubmitted')).toEqual([[{ email: 'mail@example.org' }]])
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
@ -89,14 +89,14 @@ export default {
|
||||
requestPasswordReset(email: $email)
|
||||
}
|
||||
`
|
||||
const variables = this.formData
|
||||
const { email } = this.formData
|
||||
|
||||
try {
|
||||
await this.$apollo.mutate({ mutation, variables })
|
||||
await this.$apollo.mutate({ mutation, variables: { email } })
|
||||
this.submitted = true
|
||||
|
||||
setTimeout(() => {
|
||||
this.$emit('handleSubmitted')
|
||||
this.$emit('handleSubmitted', { email })
|
||||
}, 3000)
|
||||
} catch (err) {
|
||||
this.$toast.error(err.message)
|
||||
|
||||
@ -8,13 +8,6 @@
|
||||
@input="handleInput"
|
||||
@input-valid="handleInputValid"
|
||||
>
|
||||
<ds-input
|
||||
:placeholder="$t('login.email')"
|
||||
model="email"
|
||||
id="email"
|
||||
name="email"
|
||||
icon="envelope"
|
||||
/>
|
||||
<ds-input
|
||||
:placeholder="$t('verify-code.form.code')"
|
||||
model="code"
|
||||
@ -37,18 +30,15 @@
|
||||
|
||||
<script>
|
||||
export default {
|
||||
props: {
|
||||
email: { type: String, required: true },
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
formData: {
|
||||
email: '',
|
||||
code: '',
|
||||
},
|
||||
formSchema: {
|
||||
email: {
|
||||
type: 'email',
|
||||
required: true,
|
||||
message: this.$t('common.validations.email'),
|
||||
},
|
||||
code: {
|
||||
type: 'string',
|
||||
min: 6,
|
||||
@ -68,7 +58,8 @@ export default {
|
||||
this.disabled = false
|
||||
},
|
||||
handleSubmitVerify() {
|
||||
const { email, code } = this.formData
|
||||
const { code } = this.formData
|
||||
const email = this.email
|
||||
this.$emit('verification', { email, code })
|
||||
},
|
||||
},
|
||||
|
||||
@ -10,8 +10,8 @@ export default {
|
||||
Request,
|
||||
},
|
||||
methods: {
|
||||
handlePasswordResetRequested() {
|
||||
this.$router.push('verify-code')
|
||||
handlePasswordResetRequested({ email }) {
|
||||
this.$router.push({ path: 'verify-code', query: { email } })
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<verify-code @verification="handleVerification" />
|
||||
<verify-code :email="email" @verification="handleVerification" />
|
||||
</template>
|
||||
|
||||
<script>
|
||||
@ -9,6 +9,10 @@ export default {
|
||||
components: {
|
||||
VerifyCode,
|
||||
},
|
||||
data() {
|
||||
const { email = '' } = this.$route.query
|
||||
return { email }
|
||||
},
|
||||
methods: {
|
||||
handleVerification({ email, code }) {
|
||||
this.$router.push({ path: 'change-password', query: { email, code } })
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user