fix: [stocks] Server Action 직렬화 오류 수정 (undefined → null)

- Next.js Server Actions는 undefined 직렬화 불가
- bendingLot: undefined → null
- rawLotNo/fabricLotNo/material: undefined → null (via ??)
- itemId: undefined → null
This commit is contained in:
김보곤
2026-03-18 22:31:08 +09:00
parent c3d6c6e9be
commit f4f2f4b9af

View File

@@ -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 || '',