cat-documents-ng 0.2.69 → 0.2.70
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -2369,12 +2369,14 @@ class DocumentUploadService {
|
|
|
2369
2369
|
*/
|
|
2370
2370
|
handleCreateFormData(uploadedFile, contextId) {
|
|
2371
2371
|
if (uploadedFile) {
|
|
2372
|
+
console.log("formData 1", uploadedFile);
|
|
2372
2373
|
let formData = new FormData();
|
|
2373
2374
|
formData.append(SHARED.FILE, uploadedFile, uploadedFile.name);
|
|
2374
2375
|
formData.append(SHARED.CONTEXT_ID, this.contextId);
|
|
2375
2376
|
return formData;
|
|
2376
2377
|
}
|
|
2377
2378
|
else {
|
|
2379
|
+
console.log("formData 2", uploadedFile);
|
|
2378
2380
|
return null;
|
|
2379
2381
|
}
|
|
2380
2382
|
}
|
|
@@ -3039,7 +3041,7 @@ class DocumentUploadComponent {
|
|
|
3039
3041
|
return of(null);
|
|
3040
3042
|
}
|
|
3041
3043
|
const formsData = this.documentService.handleCreateFormData(file, this.contextId);
|
|
3042
|
-
console.log("
|
|
3044
|
+
console.log("3 formsData", formsData);
|
|
3043
3045
|
if (!formsData) {
|
|
3044
3046
|
this.messageService.add({
|
|
3045
3047
|
severity: SHARED.SEVERITY,
|
|
@@ -3048,18 +3050,19 @@ class DocumentUploadComponent {
|
|
|
3048
3050
|
});
|
|
3049
3051
|
return of(null);
|
|
3050
3052
|
}
|
|
3051
|
-
const formattedSize = this.businessService.formatFileSize(file.size, this.config);
|
|
3052
|
-
const uploadedFile = this.businessService.createUploadedFile(file, formattedSize);
|
|
3053
|
-
uploadedFile.progress = SHARED.UPLOAD_PROGRESS_10;
|
|
3054
|
-
this.uploadedFiles.push(uploadedFile);
|
|
3053
|
+
// const formattedSize = this.businessService.formatFileSize(file.size, this.config);
|
|
3054
|
+
// const uploadedFile = this.businessService.createUploadedFile(file, formattedSize);
|
|
3055
|
+
// uploadedFile.progress = SHARED.UPLOAD_PROGRESS_10;
|
|
3056
|
+
// this.uploadedFiles.push(uploadedFile);
|
|
3055
3057
|
this.fileProgress.set(file, SHARED.UPLOAD_PROGRESS_10);
|
|
3056
|
-
console.log("
|
|
3058
|
+
console.log("4 formData", formsData);
|
|
3057
3059
|
return this.uploadService.create(formsData).pipe(tap((event) => {
|
|
3058
|
-
console.log("
|
|
3059
|
-
uploadedFile.uploadResponse = event;
|
|
3060
|
-
uploadedFile.progress = SHARED.UPLOAD_PROGRESS_100;
|
|
3061
|
-
uploadedFile.url = event?.url;
|
|
3062
|
-
uploadedFile.contentType = event?.contentType;
|
|
3060
|
+
console.log("5 event", event);
|
|
3061
|
+
// uploadedFile.uploadResponse = event;
|
|
3062
|
+
// uploadedFile.progress = SHARED.UPLOAD_PROGRESS_100;
|
|
3063
|
+
// uploadedFile.url = event?.url;
|
|
3064
|
+
// uploadedFile.contentType = event?.contentType;
|
|
3065
|
+
this.uploadedFiles.push(event);
|
|
3063
3066
|
this.fileProgress.set(file, SHARED.UPLOAD_PROGRESS_100);
|
|
3064
3067
|
}), catchError((error) => {
|
|
3065
3068
|
this.messageService.add({
|