Files
psalmtafel-webservice/app/api/songs/[id]/route.ts
T
robin d871bddc99 feat: add api for getSongInfos
feat: show song informations of selected song
2026-07-28 15:00:48 +02:00

20 lines
511 B
TypeScript

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 }
);
}
}