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 }; }