summaryrefslogtreecommitdiff
path: root/app/api/vendor-responses/update-comment
diff options
context:
space:
mode:
authorjoonhoekim <26rote@gmail.com>2025-12-01 19:52:06 +0900
committerjoonhoekim <26rote@gmail.com>2025-12-01 19:52:06 +0900
commit44b74ff4170090673b6eeacd8c528e0abf47b7aa (patch)
tree3f3824b4e2cb24536c1677188b4cae5b8909d3da /app/api/vendor-responses/update-comment
parent4953e770929b82ef77da074f77071ebd0f428529 (diff)
(김준회) deprecated code 정리
Diffstat (limited to 'app/api/vendor-responses/update-comment')
-rw-r--r--app/api/vendor-responses/update-comment/route.ts62
1 files changed, 0 insertions, 62 deletions
diff --git a/app/api/vendor-responses/update-comment/route.ts b/app/api/vendor-responses/update-comment/route.ts
deleted file mode 100644
index f1e4c487..00000000
--- a/app/api/vendor-responses/update-comment/route.ts
+++ /dev/null
@@ -1,62 +0,0 @@
-// app/api/vendor-responses/update-comment/route.ts
-import { NextRequest, NextResponse } from "next/server";
-import db from "@/db/db";
-import { vendorAttachmentResponses } from "@/db/schema";
-
-import { getServerSession } from "next-auth/next"
-import { authOptions } from "@/app/api/auth/[...nextauth]/route"
-import { eq } from "drizzle-orm";
-
-export async function POST(request: NextRequest) {
- try {
- // 인증 확인
- const session = await getServerSession(authOptions);
- if (!session?.user?.id) {
- return NextResponse.json(
- { message: "인증이 필요합니다." },
- { status: 401 }
- );
- }
-
- const body = await request.json();
- const { responseId, responseComment, vendorComment } = body;
-
- if (!responseId) {
- return NextResponse.json(
- { message: "응답 ID가 필요합니다." },
- { status: 400 }
- );
- }
-
- // 코멘트만 업데이트
- const [updatedResponse] = await db
- .update(vendorAttachmentResponses)
- .set({
- responseComment,
- vendorComment,
- updatedAt: new Date(),
- updatedBy:Number(session?.user.id)
- })
- .where(eq(vendorAttachmentResponses.id, parseInt(responseId)))
- .returning();
-
- if (!updatedResponse) {
- return NextResponse.json(
- { message: "응답을 찾을 수 없습니다." },
- { status: 404 }
- );
- }
-
- return NextResponse.json({
- message: "코멘트가 성공적으로 업데이트되었습니다.",
- response: updatedResponse,
- });
-
- } catch (error) {
- console.error("Comment update error:", error);
- return NextResponse.json(
- { message: "코멘트 업데이트 중 오류가 발생했습니다." },
- { status: 500 }
- );
- }
-} \ No newline at end of file