Skip to content

Commit

Permalink
Merge pull request #5129 from NMDSdevopsServiceAdm/test
Browse files Browse the repository at this point in the history
Live: Fix Admin Download Most Recent Upload
  • Loading branch information
popey2700 authored Jul 28, 2022
2 parents ce367be + 7a374d5 commit 18f5e72
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ <h1 class="govuk-heading-l">
<a
[attr.data-testid]="'link-' + file.data.filename"
href="/bulk-upload/download/{{ encodeUrl(file.data.filename) }}"
(click)="downloadFile($event, file.data.key)"
(click)="downloadFile($event, file.data.key, file.data.fileType)"
>
{{ file.data.fileType | bulkUploadFileTypePipe }}
</a>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,16 @@ export class LastBulkUploadComponent implements OnInit {
return encodeURI(url);
}

public downloadFile(event: Event, key: string): void {
public downloadFile(event: Event, key: string, fileType: string): void {
event.preventDefault();

let type: BulkUploadFileType = null;

if (key.includes('staff')) {
if (fileType === 'Worker') {
type = this.sanitise ? BulkUploadFileType.WorkerSanitise : BulkUploadFileType.Worker;
} else if (key.includes('workplace')) {
} else if (fileType === 'Establishment') {
type = BulkUploadFileType.Establishment;
} else if (key.includes('training')) {
} else if (fileType === 'Training') {
type = BulkUploadFileType.Training;
}

Expand Down

0 comments on commit 18f5e72

Please sign in to comment.