From 50adedf48ee4674ebe00f1ee72d93485183cdc51 Mon Sep 17 00:00:00 2001 From: dujinkim Date: Fri, 5 Sep 2025 11:44:32 +0000 Subject: (대표님, 최겸, 임수민) EDP 입력 진행률, 견적목록관리, EDP excel import 오류수정, GTC-Contract MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/gtc-contract/service.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'lib/gtc-contract/service.ts') diff --git a/lib/gtc-contract/service.ts b/lib/gtc-contract/service.ts index f9725f80..0d21f7aa 100644 --- a/lib/gtc-contract/service.ts +++ b/lib/gtc-contract/service.ts @@ -9,7 +9,8 @@ import { users } from "@/db/schema/users" import { vendors } from "@/db/schema/vendors" import { filterColumns } from "@/lib/filter-columns" import type { GetGtcDocumentsSchema, CreateGtcDocumentSchema, UpdateGtcDocumentSchema, CreateNewRevisionSchema, CloneGtcDocumentSchema } from "./validations" - +import { getServerSession } from "next-auth/next" +import { authOptions } from "@/app/api/auth/[...nextauth]/route" /** * 프로젝트 존재 여부 확인 */ @@ -568,7 +569,6 @@ interface ImportResult { export async function importGtcClausesFromExcel( documentId: number, data: Partial[], - userId: number = 1 // TODO: 실제 사용자 ID로 교체 ): Promise { const result: ImportResult = { success: false, @@ -577,6 +577,13 @@ export async function importGtcClausesFromExcel( duplicates: [] } + const session = await getServerSession(authOptions) + if (!session?.user?.id) { + throw new Error("인증이 필요합니다.") + } + + const userId = Number(session.user.id) + try { // 데이터 검증 및 변환 const validData: ImportGtcClauseData[] = [] -- cgit v1.2.3