feat: add api for getSongInfos
feat: show song informations of selected song
This commit is contained in:
1 parent
d6fb6ec16d
commit
d871bddc99
2 files changed
+64
-3
No files matched your search
@@ -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 }
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user