This commit is contained in:
Nile Walker 2021-02-28 19:47:06 -05:00
parent f724236d76
commit 05d5dd79e7
2 changed files with 6 additions and 6 deletions

View File

@ -119,7 +119,7 @@ export class GraphsComponent implements OnInit {
this.endDate = new Date(); this.endDate = new Date();
this.updateGraphData(); this.updateGraphData();
} }
downloadSearchResults(): void { downloadSearchResults(): void {
this.graphService.downloadSearchResults(this.form); this.graphService.downloadSearchResults(this.form);
} }

View File

@ -23,12 +23,12 @@ export class GraphService {
} }
downloadSearchResults(form: SearchForm): void { downloadSearchResults(form: SearchForm): void {
let params = this.createParams(form); const params = this.createParams(form);
this.httpClient this.httpClient
.get(this.apiRoot + `/dashboard/download`, {responseType: 'text', params: params}).subscribe((data: string) => { .get(this.apiRoot + `/dashboard/download`, {responseType: 'text', params}).subscribe((data: string) => {
let blob = new Blob([data], { type: 'text/csv' }); const blob = new Blob([data], { type: 'text/csv' });
saveAs(blob, "data.csv"); saveAs(blob, 'data.csv');
}); });
} }