From 14f61e24947fb92dd71ec0a7196a6e815f8e66da Mon Sep 17 00:00:00 2001 From: dujinkim Date: Mon, 21 Jul 2025 07:54:26 +0000 Subject: (최겸)기술영업 RFQ 담당자 초대, 요구사항 반영 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/items-tech/service.ts | 34 ++++++++++++++++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) (limited to 'lib/items-tech/service.ts') diff --git a/lib/items-tech/service.ts b/lib/items-tech/service.ts index bf2684d7..d93c5f96 100644 --- a/lib/items-tech/service.ts +++ b/lib/items-tech/service.ts @@ -405,7 +405,14 @@ export async function createShipbuildingItem(input: TypedItemCreateData) { unstable_noStore() try { - // itemCode는 nullable하게 변경 + if (!input.itemCode) { + return { + success: false, + message: "아이템 코드는 필수입니다", + data: null, + error: "필수 필드 누락" + } + } const shipData = input as ShipbuildingItemCreateData; const result = await db.insert(itemShipbuilding).values({ @@ -459,7 +466,14 @@ export async function createShipbuildingImportItem(input: { unstable_noStore(); try { - // itemCode는 nullable하게 변경 + if (!input.itemCode) { + return { + success: false, + message: "아이템 코드는 필수입니다", + data: null, + error: "필수 필드 누락" + } + } // 기존 아이템 및 선종 확인 (itemCode가 있을 경우에만) if (input.itemCode) { @@ -525,6 +539,14 @@ export async function createOffshoreTopItem(data: OffshoreTopItemCreateData) { unstable_noStore(); try { + if (!data.itemCode) { + return { + success: false, + message: "아이템 코드는 필수입니다", + data: null, + error: "필수 필드 누락" + } + } // itemCode가 있는 경우 중복 체크 if (data.itemCode && data.itemCode.trim() !== "") { const existingItem = await db @@ -586,6 +608,14 @@ export async function createOffshoreHullItem(data: OffshoreHullItemCreateData) { unstable_noStore(); try { + if (!data.itemCode) { + return { + success: false, + message: "아이템 코드는 필수입니다", + data: null, + error: "필수 필드 누락" + } + } // itemCode가 있는 경우 중복 체크 if (data.itemCode && data.itemCode.trim() !== "") { const existingItem = await db -- cgit v1.2.3