fix(Form): return false when silent validation fails (#1371)

This commit is contained in:
Romain Hamel
2024-02-18 11:11:07 +01:00
committed by GitHub
parent 31232d4d72
commit d4b6147fcc
2 changed files with 6 additions and 2 deletions

View File

@@ -10,7 +10,8 @@ export interface FormErrorWithId extends FormError {
}
export interface Form<T> {
validate(path?: string, opts?: { silent?: boolean }): Promise<T>
validate(path?: string, opts?: { silent?: true }): Promise<T | false>;
validate(path?: string, opts?: { silent?: false }): Promise<T>;
clear(path?: string): void
errors: Ref<FormError[]>
setErrors(errs: FormError[], path?: string): void