From f4f2f4b9afd4037700f8d34e5c526f9417f514e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EB=B3=B4=EA=B3=A4?= Date: Wed, 18 Mar 2026 22:31:08 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20[stocks]=20Server=20Action=20=EC=A7=81?= =?UTF-8?q?=EB=A0=AC=ED=99=94=20=EC=98=A4=EB=A5=98=20=EC=88=98=EC=A0=95=20?= =?UTF-8?q?(undefined=20=E2=86=92=20null)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Next.js Server Actions는 undefined 직렬화 불가 - bendingLot: undefined → null - rawLotNo/fabricLotNo/material: undefined → null (via ??) - itemId: undefined → null --- src/components/stocks/actions.ts | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/components/stocks/actions.ts b/src/components/stocks/actions.ts index 953c199a..d93ebf9a 100644 --- a/src/components/stocks/actions.ts +++ b/src/components/stocks/actions.ts @@ -104,15 +104,15 @@ export interface StockOrder { prodCode: string; specCode: string; lengthCode: string; - rawLotNo?: string; - fabricLotNo?: string; - material?: string; - }; + rawLotNo?: string | null; + fabricLotNo?: string | null; + material?: string | null; + } | null; } export interface StockOrderItem { id: string; - itemId?: number; + itemId?: number | null; itemCode: string; itemName: string; specification: string; @@ -209,17 +209,17 @@ function transformApiToFrontend(apiData: ApiStockOrder): StockOrder { prodCode: bendingLotData.prod_code || '', specCode: bendingLotData.spec_code || '', lengthCode: bendingLotData.length_code || '', - rawLotNo: bendingLotData.raw_lot_no, - fabricLotNo: bendingLotData.fabric_lot_no, - material: bendingLotData.material, - } : undefined, + rawLotNo: bendingLotData.raw_lot_no ?? null, + fabricLotNo: bendingLotData.fabric_lot_no ?? null, + material: bendingLotData.material ?? null, + } : null, }; } function transformItemApiToFrontend(apiItem: ApiStockOrderItem): StockOrderItem { return { id: String(apiItem.id), - itemId: apiItem.item_id ?? undefined, + itemId: apiItem.item_id ?? null, itemCode: apiItem.item_code || '', itemName: apiItem.item_name, specification: apiItem.specification || '',