Skip to content

Commit

Permalink
chore: reset login/register form errors before submit
Browse files Browse the repository at this point in the history
  • Loading branch information
sajadhsm authored and mutoe committed Mar 4, 2022
1 parent aeb56e4 commit 34aa39b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/pages/Login.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 2 additions & 0 deletions src/pages/Register.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

1 comment on commit 34aa39b

@vercel
Copy link

@vercel vercel bot commented on 34aa39b Mar 4, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.