main: second iter

Signed-off-by: nfel <nfilsaraee@gmail.com>
This commit is contained in:
2025-12-27 22:41:36 +03:30
parent 8a7842e263
commit 9a7e627329
33 changed files with 4865 additions and 81 deletions
+26
View File
@@ -0,0 +1,26 @@
import { NextRequest, NextResponse } from 'next/server';
import { albumDb } from '@/lib/db';
export async function GET(
request: NextRequest,
{ params }: { params: { id: string } }
) {
try {
const album = albumDb.getById(params.id);
if (!album) {
return NextResponse.json(
{ error: 'Album not found' },
{ status: 404 }
);
}
return NextResponse.json(album, { status: 200 });
} catch (error) {
console.error('Error fetching album:', error);
return NextResponse.json(
{ error: 'Failed to fetch album' },
{ status: 500 }
);
}
}