Browse Source

Removed manual form validation

pull/6376/head
Muhammed Mustafa 12 months ago
parent
commit
9e65f2571d
  1. 23
      packages/nc-gui/components/account/Profile.vue

23
packages/nc-gui/components/account/Profile.vue

@ -53,16 +53,9 @@ watch(
},
)
watch(
() => form.value.title,
async () => {
try {
isErrored.value = !(await formValidator.value.validate())
} catch (e: any) {
isErrored.value = true
}
},
)
const onValidate = async (_: any, valid: boolean) => {
isErrored.value = !valid
}
</script>
<template>
@ -77,7 +70,15 @@ watch(
<GeneralUserIcon size="xlarge" />
</div>
<div class="flex w-10"></div>
<a-form ref="formValidator" layout="vertical" no-style :model="form" class="flex flex-col w-full" @finish="onSubmit">
<a-form
ref="formValidator"
layout="vertical"
no-style
:model="form"
class="flex flex-col w-full"
@finish="onSubmit"
@validate="onValidate"
>
<div class="text-gray-800 mb-1.5">Name</div>
<a-form-item name="title" :rules="formRules.title">
<a-input

Loading…
Cancel
Save