feat: add api for getSongInfos

feat: show song informations of selected song
This commit is contained in:
robin committed 2026-07-28 15:00:48 +02:00
1 parent d6fb6ec16d
commit d871bddc99
2 files changed
+64 -3

No files matched your search

+20
View File
@@ -0,0 +1,20 @@
import { NextResponse } from "next/server";
import { getSongInfos } from "@/lib/db/managing";
export async function GET(
request: Request,
{ params }: { params: Promise<{ id: string }> }
) {
try {
const { id } = await params;
const songInfos = await getSongInfos(id);
return NextResponse.json(songInfos || []);
} catch (error) {
console.error("API Error:", error);
return NextResponse.json(
{ error: "Fehler beim Laden der Songinfos" },
{ status: 500 }
);
}
}