Added Download Search endpoint
This commit is contained in:
parent
d530d69724
commit
d809c3f600
|
@ -182,6 +182,7 @@ export class GraphsComponent implements OnInit {
|
|||
this.form.startDate = startDate.toLocaleDateString();
|
||||
this.form.endDate = endDate.toLocaleDateString();
|
||||
this.updateGraphData();
|
||||
this.graphService.downloadSearchResults(this.form);
|
||||
}
|
||||
|
||||
chartClicked(e: any): void {
|
||||
|
|
|
@ -21,6 +21,16 @@ export class GraphService {
|
|||
) {
|
||||
this.apiRoot = environment.api;
|
||||
}
|
||||
|
||||
downloadSearchResults(form: SearchForm): Observable<Sample[]> {
|
||||
let params = this.createParams(form);
|
||||
|
||||
return this.httpClient
|
||||
.get<Sample[]>(this.apiRoot + `/dashboard/download`, { params })
|
||||
.pipe(timeout(1000), catchError(err => this._handleError(err)))
|
||||
.pipe(catchError(err => this._handleError(err)));
|
||||
}
|
||||
|
||||
getRawSearchData(form: SearchForm, page: number): Observable<Sample[]> {
|
||||
let params = this.createParams(form);
|
||||
params = params.set('page', String(page));
|
||||
|
|
Loading…
Reference in New Issue