From 184f234ebd42c52cad961e0e67a8aef638355162 Mon Sep 17 00:00:00 2001 From: Olli Mannevaara Date: Tue, 12 Mar 2024 12:13:16 +0200 Subject: [PATCH] Changing search parameters also resets page to 1 --- .../results/publications2/publications2.component.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/app/portal/components/results/publications2/publications2.component.ts b/src/app/portal/components/results/publications2/publications2.component.ts index 409964423..753efc1f0 100644 --- a/src/app/portal/components/results/publications2/publications2.component.ts +++ b/src/app/portal/components/results/publications2/publications2.component.ts @@ -496,6 +496,8 @@ export class Publications2Component implements OnDestroy { delete queryParams[key]; } + queryParams.page = ["1"]; + this.router.navigate([], { relativeTo: this.route, // skipLocationChange: true, @@ -510,6 +512,8 @@ export class Publications2Component implements OnDestroy { queryParams[key] = [value]; + queryParams.page = ["1"]; + this.router.navigate([], { relativeTo: this.route, // skipLocationChange: true, @@ -521,8 +525,11 @@ export class Publications2Component implements OnDestroy { clearParam(key: string) { this.searchParams$.pipe(take(1)).subscribe(filterParams => { const queryParams = { ...filterParams }; + delete queryParams[key]; + queryParams.page = ["1"]; + this.router.navigate([], { relativeTo: this.route, // skipLocationChange: true,