diff --git a/src/app/graphs/graphs.component.ts b/src/app/graphs/graphs.component.ts index 0942272..a96daa6 100644 --- a/src/app/graphs/graphs.component.ts +++ b/src/app/graphs/graphs.component.ts @@ -119,7 +119,7 @@ export class GraphsComponent implements OnInit { this.endDate = new Date(); this.updateGraphData(); } - + downloadSearchResults(): void { this.graphService.downloadSearchResults(this.form); } diff --git a/src/app/services/graph.service.ts b/src/app/services/graph.service.ts index 09e7e39..7a101cc 100644 --- a/src/app/services/graph.service.ts +++ b/src/app/services/graph.service.ts @@ -23,12 +23,12 @@ export class GraphService { } downloadSearchResults(form: SearchForm): void { - let params = this.createParams(form); - + const params = this.createParams(form); + this.httpClient - .get(this.apiRoot + `/dashboard/download`, {responseType: 'text', params: params}).subscribe((data: string) => { - let blob = new Blob([data], { type: 'text/csv' }); - saveAs(blob, "data.csv"); + .get(this.apiRoot + `/dashboard/download`, {responseType: 'text', params}).subscribe((data: string) => { + const blob = new Blob([data], { type: 'text/csv' }); + saveAs(blob, 'data.csv'); }); }