feat: add duplicate transaction detection and display in transactions page, enhancing user experience with visual indicators for duplicates
This commit is contained in:
20
app/api/banking/duplicates/ids/route.ts
Normal file
20
app/api/banking/duplicates/ids/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 GET() {
|
||||
const authError = await requireAuth();
|
||||
if (authError) return authError;
|
||||
|
||||
try {
|
||||
const duplicateIds = await transactionService.getDuplicateIds();
|
||||
return NextResponse.json({ duplicateIds: Array.from(duplicateIds) });
|
||||
} catch (error) {
|
||||
console.error("Error finding duplicate IDs:", error);
|
||||
return NextResponse.json(
|
||||
{ error: "Failed to find duplicate IDs" },
|
||||
{ status: 500 },
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user