From f7be78b6c56ea9af3ac342f588cfe3ea7649a2d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B6=8C=ED=98=81=EC=84=B1?= Date: Thu, 12 Mar 2026 14:13:44 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20[qms]=20=EB=B9=8C=EB=93=9C=20=ED=83=80?= =?UTF-8?q?=EC=9E=85=20=EC=97=90=EB=9F=AC=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Day1DocumentSection: onUpload prop optional 처리 및 guard 추가 - mockData: RouteItem 타입 필수 필드 client 누락 보완 --- .../quality/qms/components/Day1DocumentSection.tsx | 6 +++--- src/app/[locale]/(protected)/quality/qms/mockData.ts | 6 ++++++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/app/[locale]/(protected)/quality/qms/components/Day1DocumentSection.tsx b/src/app/[locale]/(protected)/quality/qms/components/Day1DocumentSection.tsx index 56b64d0a..ec4cba17 100644 --- a/src/app/[locale]/(protected)/quality/qms/components/Day1DocumentSection.tsx +++ b/src/app/[locale]/(protected)/quality/qms/components/Day1DocumentSection.tsx @@ -89,7 +89,7 @@ export function Day1DocumentSection({ ))} onFileUpload?.(checkItem.subItemId, file)} + onUpload={onFileUpload ? (file) => onFileUpload(checkItem.subItemId, file) : undefined} /> @@ -125,7 +125,7 @@ export function Day1DocumentSection({ // ===== 파일 업로드 영역 ===== interface DocumentUploadAreaProps { - onUpload: (file: File) => Promise; + onUpload?: (file: File) => Promise; } function DocumentUploadArea({ onUpload }: DocumentUploadAreaProps) { @@ -158,7 +158,7 @@ function DocumentUploadArea({ onUpload }: DocumentUploadAreaProps) { }, [validateFile]); const handleConfirmUpload = useCallback(async () => { - if (!pendingFile) return; + if (!pendingFile || !onUpload) return; setUploading(true); try { const success = await onUpload(pendingFile); diff --git a/src/app/[locale]/(protected)/quality/qms/mockData.ts b/src/app/[locale]/(protected)/quality/qms/mockData.ts index 5b47eb86..48744900 100644 --- a/src/app/[locale]/(protected)/quality/qms/mockData.ts +++ b/src/app/[locale]/(protected)/quality/qms/mockData.ts @@ -105,6 +105,7 @@ export const MOCK_ROUTES_INITIAL: Record = { id: '1-1', code: 'KD-SS-240924-19', date: '2024-09-24', + client: '(주)강남건설', site: '강남 아파트 A동', locationCount: 7, subItems: [ @@ -121,6 +122,7 @@ export const MOCK_ROUTES_INITIAL: Record = { id: '1-2', code: 'KD-SS-241024-15', date: '2024-10-24', + client: '(주)강남건설', site: '강남 아파트 B동', locationCount: 7, subItems: [ @@ -134,6 +136,7 @@ export const MOCK_ROUTES_INITIAL: Record = { id: '2-1', code: 'SC-AP-241101-01', date: '2024-11-01', + client: '서초개발(주)', site: '서초 오피스텔 본관', locationCount: 8, subItems: [ @@ -147,6 +150,7 @@ export const MOCK_ROUTES_INITIAL: Record = { id: '3-1', code: 'SP-CW-240801-01', date: '2024-08-01', + client: '송파건설(주)', site: '송파 주상복합 A타워', locationCount: 10, subItems: [ @@ -157,6 +161,7 @@ export const MOCK_ROUTES_INITIAL: Record = { id: '3-2', code: 'SP-CW-240815-02', date: '2024-08-15', + client: '송파건설(주)', site: '송파 주상복합 B타워', locationCount: 8, subItems: [], @@ -165,6 +170,7 @@ export const MOCK_ROUTES_INITIAL: Record = { id: '3-3', code: 'SP-CW-240901-03', date: '2024-09-01', + client: '송파건설(주)', site: '송파 주상복합 상가동', locationCount: 3, subItems: [],