diff --git a/app/api/songbooks/route.ts b/app/api/songbooks/route.ts index 6420574..7dcaf7c 100644 --- a/app/api/songbooks/route.ts +++ b/app/api/songbooks/route.ts @@ -27,20 +27,20 @@ export async function GET(request: Request) { const res = await searchSongBooksByTitle(query); // You can enter a limit if (!res.success) { - return NextResponse.json({ message: res.error }, { status: 500 }); + return NextResponse.json({ message: res.error }, { status: res.status }); } - return NextResponse.json(res.songBooks, { status: 200 }); + return NextResponse.json(res.songBooks, { status: res.status }; } // Ansonsten alle Bücher abrufen const res = await getSongBooks(); if (!res.success) { - return NextResponse.json({ message: res.error }, { status: 500 }); + return NextResponse.json({ message: res.error }, { status: res.status }); } - return NextResponse.json(res.songBooks, { status: 200 }); + return NextResponse.json(res.songBooks, { status: res.status }); } catch (error) { console.error("GET /api/songbooks error:", error); @@ -123,11 +123,11 @@ export async function POST(request: Request) { if (!res.success) { return NextResponse.json( { message: res.error }, - { status: res.status | 500} // ALERT-TODO Implement!!! + { status: res.status } ); } - return NextResponse.json(res, { status: 201 }); + return NextResponse.json(res, { status: res.status }); } catch (error) { console.error("POST /api/songbooks error:", error);