chore: reset login/register form errors before submit

This commit is contained in:
Sajad Hashemian 2022-02-28 11:54:39 +03:30 committed by Dongsen
parent aeb56e4ce5
commit 34aa39b01f
2 changed files with 4 additions and 0 deletions

View File

@ -75,6 +75,8 @@ const form = reactive<PostLoginForm>({
const errors = ref<PostLoginErrors>({})
const login = async () => {
errors.value = {}
if (!formRef.value?.checkValidity()) return
const result = await postLogin(form)

View File

@ -83,6 +83,8 @@ const form = reactive<PostRegisterForm>({
const errors = ref<PostRegisterErrors>({})
const register = async () => {
errors.value = {}
if (!formRef.value?.checkValidity()) return
const result = await postRegister(form)