fix: useForm model change validate error

pull/7512/head
tangjinzhou 2024-04-19 10:18:04 +08:00
parent 49e1323baa
commit ffd4d8fe92
1 changed files with 7 additions and 5 deletions

View File

@ -214,11 +214,13 @@ function useForm(
const errorList = results.filter( const errorList = results.filter(
(result: { errors: string | any[] }) => result && result.errors.length, (result: { errors: string | any[] }) => result && result.errors.length,
); );
return Promise.reject({ return errorList.length
values, ? Promise.reject({
errorFields: errorList, values,
outOfDate: lastValidatePromise !== summaryPromise, errorFields: errorList,
}); outOfDate: lastValidatePromise !== summaryPromise,
})
: Promise.resolve(values);
}); });
// Do not throw in console // Do not throw in console