Skip to content

Commit

Permalink
fix(form): regression on form data
Browse files Browse the repository at this point in the history
  • Loading branch information
m0ksem committed Apr 18, 2023
1 parent 93ecea8 commit 6d1420c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/ui/src/composables/useForm/useFormParent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ export const useFormParent = <Names extends string = string>(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<Names, FormFiled>))
}, {} as Record<Names, FormFiled['value']>))
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())
Expand Down

0 comments on commit 6d1420c

Please sign in to comment.