From 580392a408c316f9db7efd1dcb93b360daa12d08 Mon Sep 17 00:00:00 2001 From: rmb <79184337+matbalba09@users.noreply.github.com> Date: Sat, 28 Mar 2026 01:30:19 +1100 Subject: [PATCH] fix: bulk uncategorize transactions API endpoint (#1054) * fix: bulk uncategorize transactions - fix API endpoint and error handling * refactor: use params object instead of URLSearchParams for delete request Simplifies the API call by passing params object directly to the delete method instead of manually building URLSearchParams. Co-Authored-By: Claude Opus 4.6 --------- Co-authored-by: Ahmed Bouhuolia Co-authored-by: Claude Opus 4.6 --- .../alerts/UncategorizeBankTransactionsBulkAlert.tsx | 9 +++++++-- packages/webapp/src/hooks/query/bank-transactions.ts | 4 ++-- 2 files changed, 9 insertions(+), 4 deletions(-) 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..f90ac812e 100644 --- a/packages/webapp/src/hooks/query/bank-transactions.ts +++ b/packages/webapp/src/hooks/query/bank-transactions.ts @@ -37,8 +37,8 @@ export function useUncategorizeTransactionsBulkAction( UncategorizeTransactionsBulkValues >( (value) => - apiRequest.post(`/cashflow/transactions/uncategorize/bulk`, { - ids: value.ids, + apiRequest.delete(`/banking/categorize/bulk`, { + params: { uncategorizedTransactionIds: value.ids }, }), { onSuccess: (res, values) => {