diff --git a/packages/webapp/src/containers/CashFlow/AccountTransactions/alerts/UncategorizeBankTransactionsBulkAlert.tsx b/packages/webapp/src/containers/CashFlow/AccountTransactions/alerts/UncategorizeBankTransactionsBulkAlert.tsx index 7b5367b53..4879dc569 100644 --- a/packages/webapp/src/containers/CashFlow/AccountTransactions/alerts/UncategorizeBankTransactionsBulkAlert.tsx +++ b/packages/webapp/src/containers/CashFlow/AccountTransactions/alerts/UncategorizeBankTransactionsBulkAlert.tsx @@ -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); }); diff --git a/packages/webapp/src/hooks/query/bank-transactions.ts b/packages/webapp/src/hooks/query/bank-transactions.ts index 166d79447..36d838d6f 100644 --- a/packages/webapp/src/hooks/query/bank-transactions.ts +++ b/packages/webapp/src/hooks/query/bank-transactions.ts @@ -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.