Skip to content

Commit

Permalink
Changing search parameters also resets page to 1
Browse files Browse the repository at this point in the history
  • Loading branch information
ommann committed Mar 12, 2024
1 parent 2fef024 commit 184f234
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -496,6 +496,8 @@ export class Publications2Component implements OnDestroy {
delete queryParams[key];
}

queryParams.page = ["1"];

this.router.navigate([], {
relativeTo: this.route,
// skipLocationChange: true,
Expand All @@ -510,6 +512,8 @@ export class Publications2Component implements OnDestroy {

queryParams[key] = [value];

queryParams.page = ["1"];

this.router.navigate([], {
relativeTo: this.route,
// skipLocationChange: true,
Expand All @@ -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,
Expand Down

0 comments on commit 184f234

Please sign in to comment.