오류 수정
CI / test (push) Successful in 4m31s
CI / pr_and_merge (push) Successful in 1m11s

This commit is contained in:
2025-12-01 18:00:31 +09:00
parent 9e75989c5d
commit c3de7df252
16 changed files with 115 additions and 5 deletions
+11 -3
View File
@@ -15,14 +15,22 @@ try {
}
interface Params {
params: {
params: Promise<{
id: string;
};
}>;
}
export async function GET(request: Request, ctx: Params) {
// Next.js 가 params 를 항상 보장하지 않는 상황을 대비해, URL 경로에서 id 를 보완적으로 파싱한다.
let id: string | undefined = ctx?.params?.id;
let id: string | undefined;
try {
const resolved = await ctx.params;
id = resolved?.id;
} catch {
id = undefined;
}
if (!id) {
try {
const url = new URL(request.url);