마에스트로 상세 화면의 처리 로그 표에 페이지네이션 추가

This commit is contained in:
2026-07-04 16:25:34 +09:00
parent 0a9aee58e0
commit 56f32f8045
7 changed files with 410 additions and 104 deletions
+28
View File
@@ -0,0 +1,28 @@
import { NextResponse } from "next/server";
import { getMaestroLogs } from "@/lib/maestros";
import { ApiError } from "@/lib/errors";
import { withApiHandler } from "@/lib/api-handler";
const CTX = "maestros/[id]/logs";
export const GET = withApiHandler<{ id: string }>(
CTX,
async (request, { params }) => {
const { id } = await params;
const maestroID = Number(id);
if (!Number.isInteger(maestroID) || maestroID <= 0) {
throw new ApiError("Invalid maestro id", 400);
}
const url = new URL(request.url);
const result = await getMaestroLogs(maestroID, url.searchParams);
if (!result) {
throw new ApiError("Not found", 404);
}
return NextResponse.json(result);
}
);