Skip to content
Source
Sign inSign up
TanStack/form

[v2] Create error map fn #2431

ClosedLeCarbonator(GitHub profile, opens in a new tab)wants to merge 2 commits intoalpha fromcreate-error-map-fnopened

Showing 23 changed files with 7 additions and 6 deletions (loading 20).

x
0 of 23 viewed, 23 left
3 additions and 2 deletionsexamples/angular/field-groups/src/bound-field.component.tsModified
View file
@@ -50,9 +50,9 @@
watchFields: this.fields().lowerBound
? [this.fields().lowerBound!]
: undefined,
- run: ({ value, parseIssues }: any) => {
+ run: ({ value }: any) => {
const valueResult = boundsSchema.safeParse(value)
- if (!valueResult.success) return parseIssues(valueResult.error.issues)
+ if (!valueResult.success) return valueResult.error.issues
const lowerName = this.fields().lowerBound
if (!lowerName) return
const lowerResult = boundsSchema.safeParse(
@@ -61,6 +61,7 @@
if (lowerResult.success && valueResult.data < lowerResult.data) {
return 'Upper bound must be greater than lower bound'
+ return undefined
},
},
])
2 additions and 2 deletionsexamples/lit/field-groups/src/field-bounds.tsModified
View file
@@ -55,9 +55,9 @@
triggers: ['change'],
watchFields: ['lowerBound'],
- run: ({ value, parseIssues }) => {