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>
This commit is contained in:
@@ -36,16 +36,10 @@ export function useUncategorizeTransactionsBulkAction(
|
|||||||
Error,
|
Error,
|
||||||
UncategorizeTransactionsBulkValues
|
UncategorizeTransactionsBulkValues
|
||||||
>(
|
>(
|
||||||
(value) => {
|
(value) =>
|
||||||
// Build query string with multiple uncategorizedTransactionIds parameters
|
apiRequest.delete(`/banking/categorize/bulk`, {
|
||||||
const params = new URLSearchParams();
|
params: { uncategorizedTransactionIds: value.ids },
|
||||||
value.ids.forEach((id) =>
|
}),
|
||||||
params.append('uncategorizedTransactionIds', String(id)),
|
|
||||||
);
|
|
||||||
return apiRequest.delete(
|
|
||||||
`/banking/categorize/bulk?${params.toString()}`,
|
|
||||||
);
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
onSuccess: (res, values) => {
|
onSuccess: (res, values) => {
|
||||||
// Invalidate the account uncategorized transactions.
|
// Invalidate the account uncategorized transactions.
|
||||||
|
|||||||
Reference in New Issue
Block a user