refactor(WEB): V2 파일 통합, store 구조 정리 및 대시보드 개선
- V2 컴포넌트를 원본에 통합 후 V2 파일 삭제 (InspectionModal, BillDetail, ContractDocumentModal, LaborDetailClient, PricingDetailClient, QuoteRegistration) - store → stores 디렉토리 이동 및 favoritesStore 추가 - dashboard_type3~5 추가 및 기존 대시보드 차트/훅 분리 - Sidebar 리팩토링 및 HeaderFavoritesBar 추가 - DashboardSwitcher 컴포넌트 추가 - 백업 파일(.v1-backup) 및 불필요 코드 정리 - InspectionPreviewModal 레이아웃 개선 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -536,59 +536,6 @@ export async function deleteItemFile(
|
||||
return data.data;
|
||||
}
|
||||
|
||||
// ===== 레거시 파일 업로드 (하위 호환성) =====
|
||||
|
||||
/**
|
||||
* @deprecated uploadItemFile 사용 권장 (ID 기반)
|
||||
* 파일 업로드 (시방서, 인정서, 전개도 등) - 품목 코드 기반
|
||||
*/
|
||||
export async function uploadFile(
|
||||
itemCode: string,
|
||||
file: File,
|
||||
fileType: 'specification' | 'certification' | 'bending_diagram'
|
||||
): Promise<{ url: string; filename: string }> {
|
||||
const formData = new FormData();
|
||||
formData.append('file', file);
|
||||
formData.append('type', fileType);
|
||||
|
||||
const token = getAuthToken();
|
||||
const headers: Record<string, string> = {};
|
||||
if (token) {
|
||||
headers['Authorization'] = `Bearer ${token}`;
|
||||
}
|
||||
|
||||
const response = await fetch(
|
||||
`${API_URL}/api/items/${encodeURIComponent(itemCode)}/files`,
|
||||
{
|
||||
method: 'POST',
|
||||
headers,
|
||||
body: formData,
|
||||
credentials: 'include',
|
||||
}
|
||||
);
|
||||
|
||||
const data = await handleApiResponse<ApiResponse<{ url: string; filename: string }>>(response);
|
||||
return data.data;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated deleteItemFile 사용 권장 (ID 기반)
|
||||
* 파일 삭제 - 품목 코드 기반
|
||||
*/
|
||||
export async function deleteFile(
|
||||
itemCode: string,
|
||||
fileType: 'specification' | 'certification' | 'bending_diagram'
|
||||
): Promise<void> {
|
||||
const response = await fetch(
|
||||
`${API_URL}/api/items/${encodeURIComponent(itemCode)}/files/${fileType}`,
|
||||
createFetchOptions({
|
||||
method: 'DELETE',
|
||||
})
|
||||
);
|
||||
|
||||
await handleApiResponse<ApiResponse<null>>(response);
|
||||
}
|
||||
|
||||
// ===== 검색 및 필터 =====
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user