diff options
Diffstat (limited to 'app/api/revision-attachment')
| -rw-r--r-- | app/api/revision-attachment/route.ts | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/app/api/revision-attachment/route.ts b/app/api/revision-attachment/route.ts index 46c2e9c9..3e72fec5 100644 --- a/app/api/revision-attachment/route.ts +++ b/app/api/revision-attachment/route.ts @@ -17,9 +17,20 @@ import { saveFile, SaveFileResult, saveFileStream } from "@/lib/file-stroage" import { 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() /* ------- 파라미터 파싱 ------- */ @@ -124,8 +135,8 @@ export async function POST(request: NextRequest) { "CREATE", att, undefined, - undefined, - uploaderName ?? undefined, + Number(session.user.id), + session.user.name, [targetSystem] ) } |
