fix(Form)!: include nested state in submit data (#3028)

This commit is contained in:
Romain Hamel
2025-01-14 10:49:39 +01:00
committed by GitHub
parent 865a47f125
commit de9ecb1d76
4 changed files with 21 additions and 9 deletions

View File

@@ -8,7 +8,7 @@ import type { GetObjectField } from './utils'
import type { Struct as SuperstructSchema } from 'superstruct'
export interface Form<T> {
validate (opts?: { name: string | string[], silent?: false, nested?: boolean }): Promise<T | false>
validate (opts?: { name?: string | string[], silent?: boolean, nested?: boolean, transform?: boolean }): Promise<T | false>
clear (path?: string): void
errors: Ref<FormError[]>
setErrors (errs: FormError[], path?: string): void
@@ -95,7 +95,7 @@ export class FormValidationException extends Error {
errors: FormErrorWithId[]
children?: FormValidationException[]
constructor(formId: string | number, errors: FormErrorWithId[], childErrors: FormValidationException[]) {
constructor(formId: string | number, errors: FormErrorWithId[], childErrors?: FormValidationException[]) {
super('Form validation exception')
this.formId = formId
this.errors = errors