Skip to content

Commit

Permalink
Add sessionStorage to configure startDate, endDate and size
Browse files Browse the repository at this point in the history
  • Loading branch information
thomedw committed May 13, 2024
1 parent 068072b commit 925335c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/app/pages/dashboard/dashboard.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ export class DashboardService {
getDetectionChartData(
pageNo: number,
pageSize: number,
searchParams?: { [key: string]: string }
searchParams?: { type: string | undefined }
) {
let params = {
type: "TRASH",
Expand Down
8 changes: 7 additions & 1 deletion src/app/pages/dialog/chart-image/chart-image.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export class ChartImageComponent implements AfterViewInit, OnInit {
paginator = {
index: 0,
length: 10,
size: 3000,
size: Number(sessionStorage.getItem("size") || 100),
last: false,
}
type = "trash"
Expand Down Expand Up @@ -97,6 +97,12 @@ export class ChartImageComponent implements AfterViewInit, OnInit {
this.dashboardService
.getDetectionChartData(pageNo, this.paginator.size, {
type: this.type?.toUpperCase(),
...(sessionStorage.getItem("startDate")
? { startDate: sessionStorage.getItem("startDate") }
: {}),
...(sessionStorage.getItem("endDate")
? { endDate: sessionStorage.getItem("endDate") }
: {}),
})
.pipe(finalize(() => (this.isLoading = false)))
.subscribe((resp) => {
Expand Down

0 comments on commit 925335c

Please sign in to comment.