From 156a50fd7347cd5d902cb0949bf48fdff83504fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B6=8C=ED=98=81=EC=84=B1?= Date: Sat, 14 Mar 2026 08:28:11 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20[build]=20=ED=83=80=EC=9E=85=20=EC=98=A4?= =?UTF-8?q?=EB=A5=98=20=EC=88=98=EC=A0=95=20(cancelledCount,=20lot=5Fno)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - order-management-sales: revertProduction 결과 구조분해로 타입 추론 수정 - WorkerScreen/actions: lot_no 접근 타입 캐스트 추가 --- .../sales/order-management-sales/[id]/page.tsx | 10 +++++----- src/components/production/WorkerScreen/actions.ts | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/app/[locale]/(protected)/sales/order-management-sales/[id]/page.tsx b/src/app/[locale]/(protected)/sales/order-management-sales/[id]/page.tsx index 64d96482..20cb0639 100644 --- a/src/app/[locale]/(protected)/sales/order-management-sales/[id]/page.tsx +++ b/src/app/[locale]/(protected)/sales/order-management-sales/[id]/page.tsx @@ -362,17 +362,17 @@ export default function OrderDetailPage() { reason: revertReason || undefined, }); if (result.success && result.data) { - setOrder(result.data.order); - if (result.data.deletedCounts) { + const { order: updatedOrder, deletedCounts, cancelledCount } = result.data; + setOrder(updatedOrder); + if (deletedCounts) { // force 모드 (개발): 물리 삭제 건수 - const { deletedCounts } = result.data; toast.success( `생산지시가 되돌려졌습니다. (작업지시 ${deletedCounts.workOrders}건, 품목 ${deletedCounts.workOrderItems}건, 결과 ${deletedCounts.workResults}건 삭제)` ); } else { // cancel 모드 (운영): 취소 처리 건수 - const msg = result.data.cancelledCount - ? `생산지시가 취소되었습니다. (${result.data.cancelledCount}건 취소)` + const msg = cancelledCount + ? `생산지시가 취소되었습니다. (${cancelledCount}건 취소)` : '생산지시가 되돌려졌습니다.'; toast.success(msg); } diff --git a/src/components/production/WorkerScreen/actions.ts b/src/components/production/WorkerScreen/actions.ts index 04726d6e..df71d8ad 100644 --- a/src/components/production/WorkerScreen/actions.ts +++ b/src/components/production/WorkerScreen/actions.ts @@ -244,7 +244,7 @@ export async function completeWorkOrder( }); if (!result.success) return { success: false, error: result.error }; // 백엔드에서 생성한 실제 LOT 번호 사용 - const lotNo = result.data?.lot_no || null; + const lotNo = (result.data as { lot_no?: string })?.lot_no; return { success: true, lotNo }; }