260714_01_ENH: 테스트 서버에서 기동 후 중간 테스트를 위한 커밋

This commit is contained in:
2026-07-14 10:59:07 +09:00
parent a8ce35f5bf
commit 192d47bdb1
180 changed files with 11942 additions and 6007 deletions

View File

@@ -9,8 +9,8 @@ export const GET = async (req: NextRequest, context: RouteContext) => {
const [action] = slug;
const contactApi = await createContactApi();
if (action === "prjct-outsource" && slug.length === 2) {
const result = await contactApi.get<string[]>(`/assign/prjct-outsource/${slug[1]}`);
if (action === "prjct-cmpn" && slug.length === 2) {
const result = await contactApi.get<string[]>(`/assign/prjct-cmpn/${slug[1]}`);
return NextResponse.json(result, { status: 200 });
}
@@ -31,7 +31,7 @@ export const PUT = async (req: NextRequest, context: RouteContext) => {
const [action] = slug;
const contactApi = await createContactApi();
if (action === "prjct-fieldwork" && slug.length === 2) {
if ((action === "prjct-fieldwork" || action === "prjct-cmpn") && slug.length === 2) {
const body = await req.json().catch(() => null);
if (!body) {
return NextResponse.json(
@@ -40,10 +40,41 @@ export const PUT = async (req: NextRequest, context: RouteContext) => {
);
}
await contactApi.put(`/assign/prjct-fieldwork/${slug[1]}`, body);
await contactApi.put(`/assign/${action}/${slug[1]}`, body);
return new NextResponse(null, { status: 204 });
}
if (action === "list" && slug.length === 3) {
const body = await req.json().catch(() => null);
if (!body) {
return NextResponse.json(
{ message: "요청 바디가 없습니다." },
{ status: 400 }
);
}
const result = await contactApi.put<number>(`/assign/list/${slug[1]}/${slug[2]}`, body);
return NextResponse.json(result, { status: 200 });
}
return NextResponse.json({ message: "Not found" }, { status: 404 });
} catch (error: unknown) {
return errorToResponse(error);
}
};
export const DELETE = async (req: NextRequest, context: RouteContext) => {
try {
const { slug = [] } = await context.params;
const [action] = slug;
const contactApi = await createContactApi();
if (action === "list" && slug[1] === "reset" && slug.length === 3) {
const body = await req.json().catch(() => null);
const result = await contactApi.del<number>(`/assign/list/reset/${slug[2]}`, { json: body });
return NextResponse.json(result, { status: 200 });
}
return NextResponse.json({ message: "Not found" }, { status: 404 });
} catch (error: unknown) {
return errorToResponse(error);