1
0
mirror of https://github.com/oceanprotocol/market.git synced 2024-12-02 05:57:29 +01:00

restore error check on input (#1989)

This commit is contained in:
Enzo Vezzaro 2023-11-02 08:44:29 -04:00 committed by GitHub
parent df4349f63f
commit 90b41c72b7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -77,16 +77,16 @@ function checkError(
parsedFieldName: string[], parsedFieldName: string[],
field: FieldInputProps<any> field: FieldInputProps<any>
) { ) {
if ( const touched = getObjectPropertyByPath(form?.touched, field?.name)
(form?.touched?.[parsedFieldName[0]]?.[parsedFieldName[1]] && const errors = getObjectPropertyByPath(form?.errors, field?.name)
form?.errors?.[parsedFieldName[0]]?.[parsedFieldName[1]]) ||
(form?.touched[field?.name] && return (
form?.errors[field?.name] && touched &&
field.name !== 'files' && errors &&
field.name !== 'links') !field.name.endsWith('.files') &&
) { !field.name.endsWith('.links') &&
return true !field.name.endsWith('consumerParameters')
} )
} }
export default function Input(props: Partial<InputProps>): ReactElement { export default function Input(props: Partial<InputProps>): ReactElement {