251210_01_ENH : 프로젝트 수정, 에디터 구현중

This commit is contained in:
2025-12-10 16:24:49 +09:00
parent dd8723861a
commit ef949a6242
57 changed files with 4459 additions and 1247 deletions

View File

@@ -0,0 +1,46 @@
import {NextRequest, NextResponse} from "next/server";
import {DataVerification, RouteContext} from "@/types/common";
import {createContactApi} from "@/lib/server-api";
import {UserInfo, UserUploadResponse} from "@/types/user";
import {errorToResponse} from "@/lib/http-util";
export const GET = async (req: NextRequest, context: RouteContext) => {
try {
const { slug = [] } = await context.params;
const [action] = slug;
const contactApi = await createContactApi();
if (action === "prjct-outsource") {
const result = await contactApi.get<string[]>(`/assign/prjct-outsource/${slug[1]}`);
return NextResponse.json(result, { status: 200 });
}
return NextResponse.json({ message: "Not found" }, { status: 404 });
} catch (error: unknown) {
return errorToResponse(error);
}
};
export const PUT = async (req: NextRequest, context: RouteContext) => {
try {
const { slug = [] } = await context.params;
const [action] = slug ?? [];
const contactApi = await createContactApi();
if(!action){
const body = await req.json().catch(() => null);
if (!body) {
return NextResponse.json(
{ message: "요청 바디가 없습니다." },
{ status: 400 }
);
}
await contactApi.put(`/assign/prjct-outsource/${slug[1]}`, body);
return new NextResponse(null, { status: 204 });
}
return NextResponse.json({ message: "Not found" }, { status: 404 });
} catch (error: unknown) {
return errorToResponse(error);
}
}