feat: implement bulk account deletion and enhance account management with folder organization and drag-and-drop functionality

This commit is contained in:
Julien Froidefond
2025-11-30 12:00:29 +01:00
parent d663fbcbd0
commit c26ba9ddc6
16 changed files with 1188 additions and 261 deletions

View File

@@ -44,6 +44,20 @@ export async function DELETE(request: Request) {
try {
const { searchParams } = new URL(request.url);
const id = searchParams.get("id");
const ids = searchParams.get("ids");
if (ids) {
// Multiple deletion
const accountIds = ids.split(",").filter(Boolean);
if (accountIds.length === 0) {
return NextResponse.json(
{ error: "At least one account ID is required" },
{ status: 400 },
);
}
await accountService.deleteMany(accountIds);
return NextResponse.json({ success: true, count: accountIds.length });
}
if (!id) {
return NextResponse.json(