mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-21 07:10:33 +00:00
fix: invalidate account cache on bulk uncategorizing
This commit is contained in:
@@ -103,9 +103,10 @@ function AccountTransactionsDataTable({
|
|||||||
|
|
||||||
// Handle selected rows change.
|
// Handle selected rows change.
|
||||||
const handleSelectedRowsChange = (selected) => {
|
const handleSelectedRowsChange = (selected) => {
|
||||||
const selectedIds = selected?.map(
|
const selectedIds = selected
|
||||||
(row) => row.original.uncategorized_transaction_id,
|
?.filter((row) => row.original.uncategorized_transaction_id)
|
||||||
);
|
?.map((row) => row.original.uncategorized_transaction_id);
|
||||||
|
|
||||||
setCategorizedTransactionsSelected(selectedIds);
|
setCategorizedTransactionsSelected(selectedIds);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ function UncategorizeBankTransactionsBulkAlert({
|
|||||||
>
|
>
|
||||||
<p>
|
<p>
|
||||||
Are you sure want to uncategorize the selected bank transactions, this
|
Are you sure want to uncategorize the selected bank transactions, this
|
||||||
action is not revertable but you can always categorize them again?
|
action is not reversible but you can always categorize them again?
|
||||||
</p>
|
</p>
|
||||||
</Alert>
|
</Alert>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -47,16 +47,17 @@ export function useUncategorizeTransactionsBulkAction(
|
|||||||
t.CASHFLOW_ACCOUNT_UNCATEGORIZED_TRANSACTIONS_INFINITY,
|
t.CASHFLOW_ACCOUNT_UNCATEGORIZED_TRANSACTIONS_INFINITY,
|
||||||
);
|
);
|
||||||
// Invalidate the account transactions.
|
// Invalidate the account transactions.
|
||||||
queryClient.invalidateQueries(
|
queryClient.invalidateQueries(t.CASHFLOW_ACCOUNT_TRANSACTIONS_INFINITY);
|
||||||
t.CASHFLOW_ACCOUNT_TRANSACTIONS_INFINITY
|
|
||||||
);
|
// Invalidate bank account summary.
|
||||||
// invalidate bank account summary.
|
|
||||||
queryClient.invalidateQueries(BANK_QUERY_KEY.BANK_ACCOUNT_SUMMARY_META);
|
queryClient.invalidateQueries(BANK_QUERY_KEY.BANK_ACCOUNT_SUMMARY_META);
|
||||||
|
|
||||||
// Invalidate the recognized transactions.
|
// Invalidate the recognized transactions.
|
||||||
queryClient.invalidateQueries([
|
queryClient.invalidateQueries([
|
||||||
BANK_QUERY_KEY.RECOGNIZED_BANK_TRANSACTIONS_INFINITY,
|
BANK_QUERY_KEY.RECOGNIZED_BANK_TRANSACTIONS_INFINITY,
|
||||||
]);
|
]);
|
||||||
|
// Invalidate the account.
|
||||||
|
queryClient.invalidateQueries(t.ACCOUNT);
|
||||||
},
|
},
|
||||||
...options,
|
...options,
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user