feat: implement bulk account deletion and enhance account management with folder organization and drag-and-drop functionality
This commit is contained in:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user