feat: add transaction deduplication feature and enhance filtering options in settings and transactions pages
This commit is contained in:
20
app/api/banking/transactions/deduplicate/route.ts
Normal file
20
app/api/banking/transactions/deduplicate/route.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
import { NextResponse } from "next/server";
|
||||
import { transactionService } from "@/services/transaction.service";
|
||||
import { requireAuth } from "@/lib/auth-utils";
|
||||
|
||||
export async function POST() {
|
||||
const authError = await requireAuth();
|
||||
if (authError) return authError;
|
||||
|
||||
try {
|
||||
const result = await transactionService.deduplicate();
|
||||
return NextResponse.json(result);
|
||||
} catch (error) {
|
||||
console.error("Error deduplicating transactions:", error);
|
||||
return NextResponse.json(
|
||||
{ error: "Failed to deduplicate transactions" },
|
||||
{ status: 500 }
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user