Fix validation errors being displayed besides alert notification

This commit is contained in:
Bubka 2023-11-21 16:04:20 +01:00
parent 9c818c69c5
commit 0ebb352df0
2 changed files with 5 additions and 3 deletions

View File

@ -25,6 +25,7 @@
* to the Create or Import form with decoded URI to prefill the form
*/
function submitQrCode() {
form.clear()
form.qrcode = qrcodeInput.value.files[0]
form.upload('/api/v1/qrcode/decode', { returnError: true }).then(response => {
@ -38,7 +39,9 @@
}
})
.catch(error => {
notify.alert({ text: trans(error.response.data.message) })
if (error.response.status !== 422) {
notify.alert({ text: error.response.data.message })
}
})
}
@ -77,8 +80,8 @@
<button v-else class="button is-link is-medium is-rounded is-main" @click="capture()">
{{ $t('twofaccounts.forms.scan_qrcode') }}
</button>
<FieldError v-if="form.errors.hasAny('qrcode')" :error="form.errors.get('qrcode')" :field="'qrcode'" />
</div>
<FieldError v-if="form.errors.hasAny('qrcode')" :error="form.errors.get('qrcode')" :field="'qrcode'" />
</div>
<!-- alternative methods -->
<div class="column is-full">

View File

@ -57,7 +57,6 @@
</RouterLink>
</p>
</div>
<FieldError v-if="form.errors.get('token') != undefined" :error="form.errors.get('token')" :field="form.token" />
<FormButtons
:submitId="'btnRecover'"
:isBusy="form.isBusy"