From cf94ea21b7ae9703ce393967d2eed633cf88cb31 Mon Sep 17 00:00:00 2001 From: kric_jspark Date: Wed, 5 Aug 2026 16:18:36 +0900 Subject: [PATCH] =?UTF-8?q?260805=5F02=5FENH:=20=EC=99=B8=EB=B6=80=20?= =?UTF-8?q?=EC=84=A4=EB=AC=B8=EC=97=90=EC=84=9C=20=EB=A6=AC=EC=8A=A4?= =?UTF-8?q?=ED=8A=B8=20=EA=B4=80=EB=A0=A8=20=EA=B8=B0=EB=8A=A5=20=EC=82=AC?= =?UTF-8?q?=EC=9A=A9=EC=8B=9C=20prjctIdx=EA=B0=80=20=EC=95=84=EB=8B=8C=20p?= =?UTF-8?q?rjctCd=EB=A1=9C=20=EB=8F=99=EC=9E=91=ED=95=98=EA=B2=8C=20?= =?UTF-8?q?=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/list-external/[[...slug]]/route.ts | 36 +++++++++---------- src/types/list.ts | 2 +- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/src/app/api/list-external/[[...slug]]/route.ts b/src/app/api/list-external/[[...slug]]/route.ts index 3418668..a0a0e72 100644 --- a/src/app/api/list-external/[[...slug]]/route.ts +++ b/src/app/api/list-external/[[...slug]]/route.ts @@ -15,17 +15,17 @@ export const GET = async (req: NextRequest, context: RouteContext) => { } const { slug = [] } = await context.params; - const [action, prjctIdx, sid] = slug; + const [action, prjctCd, sid] = slug; const contactApi = await createContactApiWithApiKey(apiKey); - if (action === "header" && prjctIdx) { - const result = await contactApi.get(`/list-external/header/${prjctIdx}`); + if (action === "header" && prjctCd) { + const result = await contactApi.get(`/list-external/header/${encodeURIComponent(prjctCd)}`); return NextResponse.json(result, { status: 200 }); } - if (action === "search" && prjctIdx && sid) { + if (action === "search" && prjctCd && sid) { const result = await contactApi.get( - `/list-external/search/${prjctIdx}/${encodeURIComponent(sid)}`, + `/list-external/search/${encodeURIComponent(prjctCd)}/${encodeURIComponent(sid)}`, ); return NextResponse.json(result, { status: 200 }); } @@ -45,13 +45,13 @@ export const PATCH = async (req: NextRequest, context: RouteContext) => { } const { slug = [] } = await context.params; - const [action, prjctIdx, sid] = slug; + const [action, prjctCd, sid] = slug; - if (action === "update" && prjctIdx && sid) { + if (action === "update" && prjctCd && sid) { const body = await req.json().catch(() => null); const contactApi = await createContactApiWithApiKey(apiKey); const result = await contactApi.patch( - `/list-external/update/${prjctIdx}/${encodeURIComponent(sid)}`, + `/list-external/update/${encodeURIComponent(prjctCd)}/${encodeURIComponent(sid)}`, body, ); return NextResponse.json(result, { status: 200 }); @@ -74,35 +74,35 @@ export const POST = async (req: NextRequest, context: RouteContext) => { const { slug = [] } = await context.params; const [action] = slug; const { searchParams } = req.nextUrl; - const prjctIdx = searchParams.get("prjctIdx"); + const prjctCd = searchParams.get("prjctCd"); const sid = searchParams.get("sid"); const contactApi = await createContactApiWithApiKey(apiKey); if (action === "header") { - if (!prjctIdx) { - return NextResponse.json({ message: "prjctIdx는 필수입니다." }, { status: 400 }); + if (!prjctCd) { + return NextResponse.json({ message: "prjctCd는 필수입니다." }, { status: 400 }); } - const result = await contactApi.get(`/list-external/header/${prjctIdx}`); + const result = await contactApi.get(`/list-external/header/${encodeURIComponent(prjctCd)}`); return NextResponse.json(result, { status: 200 }); } if (action === "search") { - if (!prjctIdx || !sid) { - return NextResponse.json({ message: "prjctIdx, sid는 필수입니다." }, { status: 400 }); + if (!prjctCd || !sid) { + return NextResponse.json({ message: "prjctCd, sid는 필수입니다." }, { status: 400 }); } const result = await contactApi.get( - `/list-external/search/${prjctIdx}/${encodeURIComponent(sid)}`, + `/list-external/search/${encodeURIComponent(prjctCd)}/${encodeURIComponent(sid)}`, ); return NextResponse.json(result, { status: 200 }); } if (action === "update") { - if (!prjctIdx || !sid) { - return NextResponse.json({ message: "prjctIdx, sid는 필수입니다." }, { status: 400 }); + if (!prjctCd || !sid) { + return NextResponse.json({ message: "prjctCd, sid는 필수입니다." }, { status: 400 }); } const body = await req.json().catch(() => null); const result = await contactApi.patch( - `/list-external/update/${prjctIdx}/${encodeURIComponent(sid)}`, + `/list-external/update/${encodeURIComponent(prjctCd)}/${encodeURIComponent(sid)}`, body, ); return NextResponse.json(result, { status: 200 }); diff --git a/src/types/list.ts b/src/types/list.ts index bd21367..51c1f95 100644 --- a/src/types/list.ts +++ b/src/types/list.ts @@ -369,7 +369,7 @@ export type ListSearchWithFullResult = ListSearchWithResult & { }; export type ListSearchExternal = { - prjctIdx: number; + prjctCd: string; sid: string; itemList: Record; }; -- 2.49.0.windows.1