From 74412a1161a3d53be287f22b66727cd18561db22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B0=95=EC=98=81=EB=B3=B4?= Date: Fri, 20 Mar 2026 15:50:30 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20[=EC=A0=9C=ED=92=88=EA=B2=80=EC=82=AC]?= =?UTF-8?q?=20=EA=B2=80=EC=82=AC=20=EC=99=84=EB=A3=8C=20=ED=98=B8=EC=B6=9C?= =?UTF-8?q?=20=EA=B2=BD=EB=A1=9C=20=EC=88=98=EC=A0=95=20+=20=EC=99=84?= =?UTF-8?q?=EB=A3=8C=20=ED=9B=84=20=EB=AA=A9=EB=A1=9D=20=EC=9D=B4=EB=8F=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - completeInspection 호출 URL을 /api/v1/inspections → /api/v1/quality/documents로 수정 (잘못된 production 모듈 호출로 "검사결과는 필수항목입니다" 에러 발생하던 문제) - 검사 완료 성공 시 목록 페이지(/quality/inspections)로 이동하도록 수정 Co-Authored-By: Claude Opus 4.6 (1M context) --- .../quality/InspectionManagement/InspectionDetail.tsx | 4 ++-- src/components/quality/InspectionManagement/actions.ts | 9 +-------- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/src/components/quality/InspectionManagement/InspectionDetail.tsx b/src/components/quality/InspectionManagement/InspectionDetail.tsx index 17aed631..3c2a98b5 100644 --- a/src/components/quality/InspectionManagement/InspectionDetail.tsx +++ b/src/components/quality/InspectionManagement/InspectionDetail.tsx @@ -286,7 +286,7 @@ export function InspectionDetail({ id }: InspectionDetailProps) { if (result.success) { toast.success('검사가 완료 처리되었습니다.'); setShowCompleteDialog(false); - loadInspection(); + router.push('/quality/inspections'); } else { toast.error(result.error || '검사 완료 처리에 실패했습니다.'); } @@ -296,7 +296,7 @@ export function InspectionDetail({ id }: InspectionDetailProps) { } finally { setIsCompleting(false); } - }, [id, loadInspection]); + }, [id, router]); // ===== 수정 제출 ===== const handleSubmit = useCallback(async (): Promise<{ success: boolean; error?: string }> => { diff --git a/src/components/quality/InspectionManagement/actions.ts b/src/components/quality/InspectionManagement/actions.ts index 992f4285..c11c8d43 100644 --- a/src/components/quality/InspectionManagement/actions.ts +++ b/src/components/quality/InspectionManagement/actions.ts @@ -675,22 +675,15 @@ export async function deleteInspection(id: string): Promise<{ export async function completeInspection( id: string, - data?: { result?: '합격' | '불합격' } ): Promise<{ success: boolean; data?: ProductInspection; error?: string; __authError?: boolean; }> { - const apiData: Record = {}; - if (data?.result) { - apiData.result = data.result === '합격' ? 'pass' : 'fail'; - } - const result = await executeServerAction({ - url: buildApiUrl(`/api/v1/inspections/${id}/complete`), + url: buildApiUrl(`/api/v1/quality/documents/${id}/complete`), method: 'PATCH', - body: apiData, errorMessage: '검사 완료 처리에 실패했습니다.', });