fix(Form): use parsed value from joi instead of original state (#2587)

This commit is contained in:
kyyy
2024-11-12 01:29:46 +07:00
committed by GitHub
parent 1fd5fac295
commit acecff40ec

View File

@@ -252,10 +252,10 @@ async function validateJoiSchema(
schema: JoiSchema
): Promise<ValidateReturnSchema<typeof state>> {
try {
await schema.validateAsync(state, { abortEarly: false })
const result = await schema.validateAsync(state, { abortEarly: false })
return {
errors: null,
result: state
result
}
} catch (error) {
if (isJoiError(error)) {