Merge pull request #1239 from atmire/Fix-hardcoded-submission-section-IDs

Fix hardcoded submission section IDs
This commit is contained in:
Art Lowel
2021-07-08 15:14:47 +02:00
committed by GitHub
9 changed files with 114 additions and 67 deletions

View File

@@ -288,14 +288,13 @@ export class SubmissionSectionUploadFileComponent implements OnChanges, OnInit {
this.pathCombiner.subRootElement);
})
).subscribe((result: SubmissionObject[]) => {
if (result[0].sections.upload) {
Object.keys((result[0].sections.upload as WorkspaceitemSectionUploadObject).files)
.filter((key) => (result[0].sections.upload as WorkspaceitemSectionUploadObject).files[key].uuid === this.fileId)
if (result[0].sections[this.sectionId]) {
const uploadSection = (result[0].sections[this.sectionId] as WorkspaceitemSectionUploadObject);
Object.keys(uploadSection.files)
.filter((key) => uploadSection.files[key].uuid === this.fileId)
.forEach((key) => this.uploadService.updateFileData(
this.submissionId,
this.sectionId,
this.fileId,
(result[0].sections.upload as WorkspaceitemSectionUploadObject).files[key]));
this.submissionId, this.sectionId, this.fileId, uploadSection.files[key])
);
}
this.switchMode();
}));