add phone validation alert

This commit is contained in:
Pete Matsyburka
2024-01-23 21:58:19 +02:00
parent e6052ad0d8
commit 2a292c8e80
@@ -140,7 +140,11 @@ export default {
})
},
async submit () {
if (!this.isCodeSent) {
if (!this.$refs.phone.value.toString().startsWith('+')) {
alert(this.t('use_international_format'))
return Promise.reject(new Error('phone invalid'))
} else if (!this.isCodeSent) {
this.sendVerificationCode()
this.$emit('update:model-value', this.$refs.phone.value)