fix: [qms] 빌드 타입 에러 수정

- Day1DocumentSection: onUpload prop optional 처리 및 guard 추가
- mockData: RouteItem 타입 필수 필드 client 누락 보완
This commit is contained in:
2026-03-12 14:13:44 +09:00
parent bb1e4a25a1
commit f7be78b6c5
2 changed files with 9 additions and 3 deletions

View File

@@ -89,7 +89,7 @@ export function Day1DocumentSection({
))}
</div>
<DocumentUploadArea
onUpload={(file) => onFileUpload?.(checkItem.subItemId, file)}
onUpload={onFileUpload ? (file) => onFileUpload(checkItem.subItemId, file) : undefined}
/>
</div>
@@ -125,7 +125,7 @@ export function Day1DocumentSection({
// ===== 파일 업로드 영역 =====
interface DocumentUploadAreaProps {
onUpload: (file: File) => Promise<boolean>;
onUpload?: (file: File) => Promise<boolean>;
}
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);

View File

@@ -105,6 +105,7 @@ export const MOCK_ROUTES_INITIAL: Record<string, RouteItem[]> = {
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<string, RouteItem[]> = {
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<string, RouteItem[]> = {
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<string, RouteItem[]> = {
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<string, RouteItem[]> = {
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<string, RouteItem[]> = {
id: '3-3',
code: 'SP-CW-240901-03',
date: '2024-09-01',
client: '송파건설(주)',
site: '송파 주상복합 상가동',
locationCount: 3,
subItems: [],