fix: [제품검사] 검사 완료 호출 경로 수정 + 완료 후 목록 이동

- completeInspection 호출 URL을 /api/v1/inspections → /api/v1/quality/documents로 수정
  (잘못된 production 모듈 호출로 "검사결과는 필수항목입니다" 에러 발생하던 문제)
- 검사 완료 성공 시 목록 페이지(/quality/inspections)로 이동하도록 수정

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-20 15:50:30 +09:00
parent 21d00bbe54
commit 74412a1161
2 changed files with 3 additions and 10 deletions

View File

@@ -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 }> => {

View File

@@ -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<string, unknown> = {};
if (data?.result) {
apiData.result = data.result === '합격' ? 'pass' : 'fail';
}
const result = await executeServerAction<ProductInspectionApi>({
url: buildApiUrl(`/api/v1/inspections/${id}/complete`),
url: buildApiUrl(`/api/v1/quality/documents/${id}/complete`),
method: 'PATCH',
body: apiData,
errorMessage: '검사 완료 처리에 실패했습니다.',
});