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 schema: JoiSchema
): Promise<ValidateReturnSchema<typeof state>> { ): Promise<ValidateReturnSchema<typeof state>> {
try { try {
await schema.validateAsync(state, { abortEarly: false }) const result = await schema.validateAsync(state, { abortEarly: false })
return { return {
errors: null, errors: null,
result: state result
} }
} catch (error) { } catch (error) {
if (isJoiError(error)) { if (isJoiError(error)) {