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:
parent
df4349f63f
commit
90b41c72b7
@ -77,16 +77,16 @@ function checkError(
|
||||
parsedFieldName: string[],
|
||||
field: FieldInputProps<any>
|
||||
) {
|
||||
if (
|
||||
(form?.touched?.[parsedFieldName[0]]?.[parsedFieldName[1]] &&
|
||||
form?.errors?.[parsedFieldName[0]]?.[parsedFieldName[1]]) ||
|
||||
(form?.touched[field?.name] &&
|
||||
form?.errors[field?.name] &&
|
||||
field.name !== 'files' &&
|
||||
field.name !== 'links')
|
||||
) {
|
||||
return true
|
||||
}
|
||||
const touched = getObjectPropertyByPath(form?.touched, field?.name)
|
||||
const errors = getObjectPropertyByPath(form?.errors, field?.name)
|
||||
|
||||
return (
|
||||
touched &&
|
||||
errors &&
|
||||
!field.name.endsWith('.files') &&
|
||||
!field.name.endsWith('.links') &&
|
||||
!field.name.endsWith('consumerParameters')
|
||||
)
|
||||
}
|
||||
|
||||
export default function Input(props: Partial<InputProps>): ReactElement {
|
||||
|
Loading…
Reference in New Issue
Block a user