From 7c1fc823bb9be772ac365db17c9cd7ba8a2a7c6d Mon Sep 17 00:00:00 2001 From: Nile Walker Date: Thu, 4 Mar 2021 08:58:49 -0500 Subject: [PATCH] Fixed bug with pagination not going back to first page after search --- src/app/graphs/graphs.component.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/graphs/graphs.component.ts b/src/app/graphs/graphs.component.ts index a96daa6..cb9e6d9 100644 --- a/src/app/graphs/graphs.component.ts +++ b/src/app/graphs/graphs.component.ts @@ -125,7 +125,6 @@ export class GraphsComponent implements OnInit { } updateGraphData(): void { - if (this.form.location.trim().split(' ').length === 1) { this.ChartName = 'Total Samples per Station @ Location ' + this.form.location; } else { @@ -176,7 +175,8 @@ export class GraphsComponent implements OnInit { this.graphService.getTopBarData(this.form).subscribe(tempData => { this.topBarData = tempData; }); - this.graphService.getRawSearchData(this.form, 0).subscribe(searchResult => this.searchResult = searchResult); + this.currentPage = 0; + this.graphService.getRawSearchData(this.form, this.currentPage).subscribe(searchResult => this.searchResult = searchResult); } ngOnInit(): void {