1
0

fix: bulk uncategorize transactions - fix API endpoint and error handling

This commit is contained in:
root
2026-03-25 03:48:23 +00:00
parent cfbfc0b746
commit a4478378ea
2 changed files with 17 additions and 6 deletions
@@ -35,11 +35,16 @@ function UncategorizeBankTransactionsBulkAlert({
uncategorizeTransactions({ ids: uncategorizeTransactionsIds })
.then(() => {
AppToaster.show({
message: 'The bank feeds of the bank account has been resumed.',
message: 'The selected transactions have been uncategorized.',
intent: Intent.SUCCESS,
});
})
.catch((error) => {})
.catch((error) => {
AppToaster.show({
message: 'Something went wrong while uncategorizing transactions.',
intent: Intent.DANGER,
});
})
.finally(() => {
closeAlert(name);
});
@@ -36,10 +36,16 @@ export function useUncategorizeTransactionsBulkAction(
Error,
UncategorizeTransactionsBulkValues
>(
(value) =>
apiRequest.post(`/cashflow/transactions/uncategorize/bulk`, {
ids: value.ids,
}),
(value) => {
// Build query string with multiple uncategorizedTransactionIds parameters
const params = new URLSearchParams();
value.ids.forEach((id) =>
params.append('uncategorizedTransactionIds', String(id)),
);
return apiRequest.delete(
`/banking/categorize/bulk?${params.toString()}`,
);
},
{
onSuccess: (res, values) => {
// Invalidate the account uncategorized transactions.