From 6d1420ccafd5270697872dfcb57489dce12101c2 Mon Sep 17 00:00:00 2001 From: Maksim Nedoshev Date: Tue, 18 Apr 2023 13:04:10 +0300 Subject: [PATCH] fix(form): regression on form data --- packages/ui/src/composables/useForm/useFormParent.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/ui/src/composables/useForm/useFormParent.ts b/packages/ui/src/composables/useForm/useFormParent.ts index a6c1e1b620..baa914a007 100644 --- a/packages/ui/src/composables/useForm/useFormParent.ts +++ b/packages/ui/src/composables/useForm/useFormParent.ts @@ -36,9 +36,9 @@ export const useFormParent = (options: FormParent const fieldNames = computed(() => fields.value.map((field) => unref(field.name)).filter(Boolean) as Names[]) const formData = computed(() => fields.value.reduce((acc, field) => { - if (unref(field.name)) { acc[unref(field.name) as Names] = field } + if (unref(field.name)) { acc[unref(field.name) as Names] = field.value } return acc - }, {} as Record)) + }, {} as Record)) const isValid = computed(() => fields.value.every((field) => unref(field.isValid))) const isLoading = computed(() => fields.value.some((field) => unref(field.isLoading))) const errorMessages = computed(() => fields.value.map((field) => unref(field.errorMessages)).flat())