diff --git a/packages/nc-gui-v2/components/smartsheet/Form.vue b/packages/nc-gui-v2/components/smartsheet/Form.vue index 052725d9b4..f676dcf0dd 100644 --- a/packages/nc-gui-v2/components/smartsheet/Form.vue +++ b/packages/nc-gui-v2/components/smartsheet/Form.vue @@ -19,6 +19,8 @@ const toast = useToast() const state = useGlobal() +const formRef = ref() + const { $api, $e } = useNuxtApp() const { isUIAllowed } = useUIPermission() @@ -78,8 +80,14 @@ const formView = ref({}) function updateView() {} -function submitForm() { - // TODO: validation +async function submitForm() { + try { + await formRef.value?.validateFields() + } catch (e: any) { + e.errorFields.map((f: Record) => toast.error(f.errors.join(','))) + return + } + insertRow(formState) } @@ -334,7 +342,7 @@ watch( - +
@@ -362,74 +370,86 @@ watch( @click="updateView" /> - - - + +