fix: filter key pass the array type

This commit is contained in:
Joel 2024-10-18 10:55:28 +08:00
parent f841d8af7c
commit 9b95eef090

View File

@ -48,12 +48,12 @@ const FilterCondition: FC<Props> = ({
return []
}
return []
}, [condition.comparison_operator, condition.key, isSelect, t, isArrayValue])
}, [condition.comparison_operator, condition.key, isSelect, t])
const handleChange = useCallback((key: string) => {
return (value: any) => {
onChange({
...condition,
[key]: isArrayValue ? [value] : value,
[key]: (isArrayValue && key === 'value') ? [value] : value,
})
}
}, [condition, onChange, isArrayValue])