diff options
| author | dujinkim <dujin.kim@dtsolution.co.kr> | 2025-10-01 10:31:23 +0000 |
|---|---|---|
| committer | dujinkim <dujin.kim@dtsolution.co.kr> | 2025-10-01 10:31:23 +0000 |
| commit | 74843fe598702a9a55f914f2d2d291368a5abb13 (patch) | |
| tree | a88abdaf039f51dd843e0416321f08877b17ea75 /app/api/revision-upload/route.ts | |
| parent | 33e8452331c301430191b3506825ebaf3edac93a (diff) | |
(대표님) dolce 수정, spreadjs 수정 등
Diffstat (limited to 'app/api/revision-upload/route.ts')
| -rw-r--r-- | app/api/revision-upload/route.ts | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/app/api/revision-upload/route.ts b/app/api/revision-upload/route.ts index 0f67def6..6517cd08 100644 --- a/app/api/revision-upload/route.ts +++ b/app/api/revision-upload/route.ts @@ -18,9 +18,22 @@ import { logRevisionChange, logAttachmentChange, } from "@/lib/vendor-document-list/sync-service" +import { getServerSession } from 'next-auth'; +import { authOptions } from '@/app/api/auth/[...nextauth]/route'; + export async function POST(request: NextRequest) { try { + + const session = await getServerSession(authOptions); + if (!session?.user?.id) { + return NextResponse.json( + { error: '인증이 필요합니다' }, + { status: 401 } + ); + } + + const formData = await request.formData() /* ------- 파라미터 파싱 ------- */ @@ -136,8 +149,8 @@ export async function POST(request: NextRequest) { "CREATE", newRev, undefined, - undefined, - uploaderName ?? undefined, + Number(session.user.id), + session.user.name, [targetSystem] ) } else { @@ -169,8 +182,8 @@ export async function POST(request: NextRequest) { "UPDATE", updated, revRow, - undefined, - uploaderName ?? undefined, + Number(session.user.id), + session.user.name, [targetSystem] ) } @@ -227,8 +240,8 @@ export async function POST(request: NextRequest) { "CREATE", att, undefined, - undefined, - uploaderName ?? undefined, + Number(session.user.id), + session.user.name, [targetSystem] ) } |
