feat: add BackupCard component and corresponding Backup model to enhance settings functionality and data management

This commit is contained in:
Julien Froidefond
2025-11-30 07:50:47 +01:00
parent f17b83fb95
commit 7cb1d5f433
15 changed files with 1102 additions and 1 deletions

View File

@@ -0,0 +1,20 @@
import { NextRequest, NextResponse } from "next/server";
import { backupService } from "@/services/backup.service";
export async function DELETE(
request: NextRequest,
{ params }: { params: Promise<{ id: string }> | { id: string } }
) {
try {
const resolvedParams = params instanceof Promise ? await params : params;
await backupService.deleteBackup(resolvedParams.id);
return NextResponse.json({ success: true });
} catch (error) {
console.error("Error deleting backup:", error);
return NextResponse.json(
{ success: false, error: error instanceof Error ? error.message : "Failed to delete backup" },
{ status: 500 }
);
}
}