조사사업 등록·결과 업로드 및 관로·맨홀 종합집계 화면 구현
This commit is contained in:
@@ -21,6 +21,7 @@ type UploadOptions = {
|
||||
handleProgress?: (percentage: string) => void;
|
||||
handleSuccess?: (upload: Upload) => void;
|
||||
handleResponse?: (res: HttpResponse) => void;
|
||||
handleError?: (error: Error) => void;
|
||||
};
|
||||
|
||||
export const handleUpload = (files: FileList, options?: UploadOptions) => {
|
||||
@@ -43,6 +44,7 @@ export const handleUpload = (files: FileList, options?: UploadOptions) => {
|
||||
metadata,
|
||||
onError(error) {
|
||||
console.error(`Failed because: ${error}`);
|
||||
options?.handleError?.(error);
|
||||
},
|
||||
onProgress(bytesUploaded, bytesTotal) {
|
||||
const percentage = ((bytesUploaded / bytesTotal) * 100).toFixed(2);
|
||||
|
||||
Reference in New Issue
Block a user