mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-17 21:30:31 +00:00
feat: run re-recognizing bank transactions on edit bank rule
This commit is contained in:
@@ -177,12 +177,12 @@ function RuleFormConditions() {
|
||||
setFieldValue('conditions', _conditions);
|
||||
};
|
||||
|
||||
const handleConditionFieldChange = (item) => {
|
||||
const handleConditionFieldChange = R.curry((index, item) => {
|
||||
const defaultComparator = getDefaultFieldConditionByFieldKey(item.value);
|
||||
|
||||
|
||||
setFieldValue(`conditions[${index}].field`, item.value);
|
||||
setFieldValue(`conditions[${index}].comparator`, defaultComparator);
|
||||
};
|
||||
});
|
||||
|
||||
return (
|
||||
<Box style={{ marginBottom: 15 }}>
|
||||
@@ -199,7 +199,7 @@ function RuleFormConditions() {
|
||||
name={`conditions[${index}].field`}
|
||||
items={Fields}
|
||||
popoverProps={{ minimal: true, inline: false }}
|
||||
onItemChange={handleConditionFieldChange}
|
||||
onItemChange={handleConditionFieldChange(index)}
|
||||
fastField
|
||||
/>
|
||||
</FFormGroup>
|
||||
|
||||
@@ -84,6 +84,6 @@ export const getDefaultFieldConditionByFieldKey = (fieldKey?: string) => {
|
||||
case 'amount':
|
||||
return 'bigger_or_equal';
|
||||
default:
|
||||
return 'equals';
|
||||
return 'contains';
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user