feat: add admin tags and albums APIs

This commit is contained in:
William Valentin
2026-02-01 17:57:10 -08:00
parent 6a38f3b4ea
commit 51aba941d6
7 changed files with 574 additions and 0 deletions

View File

@@ -0,0 +1,17 @@
import { getAdminOk, handleCreateAlbum, handleListAlbums } from "./handlers";
export const runtime = "nodejs";
export async function GET(request: Request): Promise<Response> {
const res = await handleListAlbums({ adminOk: getAdminOk(request.headers) });
return Response.json(res.body, { status: res.status });
}
export async function POST(request: Request): Promise<Response> {
const bodyJson = await request.json().catch(() => ({}));
const res = await handleCreateAlbum({
adminOk: getAdminOk(request.headers),
body: bodyJson,
});
return Response.json(res.body, { status: res.status });
}