mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-23 08:20:39 +01:00
refactor(Form): rename validation functions and vars for clarity (#3029)
Co-authored-by: Benjamin Canac <canacb1@gmail.com>
This commit is contained in:
@@ -43,7 +43,7 @@ export type FormSubmitEvent<T> = SubmitEvent & { data: T }
|
||||
|
||||
export type FormValidationError = {
|
||||
errors: FormErrorWithId[]
|
||||
childrens: FormValidationError[]
|
||||
children?: FormValidationError[]
|
||||
}
|
||||
|
||||
export type FormErrorEvent = SubmitEvent & FormValidationError
|
||||
@@ -93,13 +93,13 @@ export interface ValidateReturnSchema<T> {
|
||||
export class FormValidationException extends Error {
|
||||
formId: string | number
|
||||
errors: FormErrorWithId[]
|
||||
childrens: FormValidationException[]
|
||||
children?: FormValidationException[]
|
||||
|
||||
constructor(formId: string | number, errors: FormErrorWithId[], childErrors: FormValidationException[]) {
|
||||
super('Form validation exception')
|
||||
this.formId = formId
|
||||
this.errors = errors
|
||||
this.childrens = childErrors
|
||||
this.children = childErrors
|
||||
Object.setPrototypeOf(this, FormValidationException.prototype)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user