File tree 1 file changed +7
-7
lines changed
1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -179,26 +179,26 @@ export default function validateFormData(
179
179
formerMetaSchema = additionalMetaSchemas ;
180
180
}
181
181
182
- let validationErrors = null ;
182
+ let validationError = null ;
183
183
try {
184
184
ajv . validate ( schema , formData ) ;
185
185
} catch ( err ) {
186
- validationErrors = err ;
186
+ validationError = err ;
187
187
}
188
+
188
189
let errors = transformAjvErrors ( ajv . errors ) ;
190
+ // Clear errors to prevent persistent errors, see #1104
189
191
190
- if ( validationErrors && validationErrors . message ) {
192
+ ajv . errors = null ;
193
+ if ( validationError && validationError . message ) {
191
194
errors = [
192
195
...errors ,
193
196
{
194
- stack : validationErrors . message ,
197
+ stack : validationError . message ,
195
198
} ,
196
199
] ;
197
200
}
198
201
199
- // Clear errors to prevent persistent errors, see #1104
200
- ajv . errors = null ;
201
-
202
202
if ( typeof transformErrors === "function" ) {
203
203
errors = transformErrors ( errors ) ;
204
204
}
You can’t perform that action at this time.
0 commit comments