Skip to content

Commit 4204078

Browse files
committed
fix: update validation command
1 parent 1fb66b3 commit 4204078

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

packages/core/src/forms/axioma/commands/validate-form.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import type { BaseCommand, BaseHandler } from '@fancy-crud/bus'
22
import type { BaseObjectWithNormalizedFields, NormalizedField, RuleConfig } from '@packages/core/forms/axioma'
33
import { meta } from '@fancy-crud/bus'
44

5-
type MinimumNormalizedField = Pick<NormalizedField, 'rules' | 'errors' | 'modelValue' | 'modelKey'>
5+
type MinimumNormalizedField = Pick<NormalizedField, 'rules' | 'errors' | 'modelValue' | 'modelKey' | 'hidden' | 'exclude'>
66

77
export class ValidateFormCommand implements BaseCommand {
88
public readonly meta = meta(IValidateFormHandler)

packages/core/src/forms/capabilities/validate-form.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,10 @@ export class ValidateFormHandler implements IValidateFormHandler {
99

1010
execute({ fields, options }: ValidateFormCommand): boolean {
1111
const isValid = Object.values(fields).every((field) => {
12-
const command = new ValidateFieldRulesCommand(field, options)
13-
1412
if (field.hidden || field.exclude)
1513
return true
1614

15+
const command = new ValidateFieldRulesCommand(field, options)
1716
const result = this.validateFieldRules.execute(command)
1817
return result === true
1918
})

0 commit comments

Comments
 (0)