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 <noreply@anthropic.com> --------- Co-authored-by: Ahmed Bouhuolia <a.bouhuolia@gmail.com> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
+7
-2
@@ -35,11 +35,16 @@ function UncategorizeBankTransactionsBulkAlert({
|
|||||||
uncategorizeTransactions({ ids: uncategorizeTransactionsIds })
|
uncategorizeTransactions({ ids: uncategorizeTransactionsIds })
|
||||||
.then(() => {
|
.then(() => {
|
||||||
AppToaster.show({
|
AppToaster.show({
|
||||||
message: 'The bank feeds of the bank account has been resumed.',
|
message: 'The selected transactions have been uncategorized.',
|
||||||
intent: Intent.SUCCESS,
|
intent: Intent.SUCCESS,
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
.catch((error) => {})
|
.catch((error) => {
|
||||||
|
AppToaster.show({
|
||||||
|
message: 'Something went wrong while uncategorizing transactions.',
|
||||||
|
intent: Intent.DANGER,
|
||||||
|
});
|
||||||
|
})
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
closeAlert(name);
|
closeAlert(name);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -37,8 +37,8 @@ export function useUncategorizeTransactionsBulkAction(
|
|||||||
UncategorizeTransactionsBulkValues
|
UncategorizeTransactionsBulkValues
|
||||||
>(
|
>(
|
||||||
(value) =>
|
(value) =>
|
||||||
apiRequest.post(`/cashflow/transactions/uncategorize/bulk`, {
|
apiRequest.delete(`/banking/categorize/bulk`, {
|
||||||
ids: value.ids,
|
params: { uncategorizedTransactionIds: value.ids },
|
||||||
}),
|
}),
|
||||||
{
|
{
|
||||||
onSuccess: (res, values) => {
|
onSuccess: (res, values) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user