fix: strongly types field validation args (#8263)
Continuation of #8243. Strongly types the `value` argument within `field.validate` functions: - Uses existing internal validation types for field `validate` property - Exports additional validation types to cover `hasMany` fields - Includes `null` and `undefined` values
This commit is contained in:
@@ -60,7 +60,7 @@ const NumberFields: CollectionConfig = {
|
||||
name: 'validatesHasMany',
|
||||
type: 'number',
|
||||
hasMany: true,
|
||||
validate: (value: number[]) => {
|
||||
validate: (value) => {
|
||||
if (value && !Array.isArray(value)) {
|
||||
return 'value should be an array'
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user