Skip to content

Commit

Permalink
98 stronicowanie przy filtrowaniu tras (#99)
Browse files Browse the repository at this point in the history
* fix: when searching route by name, page number returns to 1

* fix: when editing map location, header is correct now
  • Loading branch information
Kondziow authored Jul 20, 2024
1 parent 238aa92 commit 17494e3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,12 @@
</div>
</div>
<form [formGroup]="mapLocationForm" (ngSubmit)="onSubmit()">
<div class="col-xs-12">
<div *ngIf="!editMode" class="col-xs-12">
<h2>Adding New Point</h2>
</div>
<div *ngIf="editMode" class="col-xs-12">
<h2>Editing map location</h2>
</div>
<div class="row">
<div class="col-xs-12">
<button
Expand Down
5 changes: 4 additions & 1 deletion src/app/route/route-list/route-list.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,12 @@ export class RouteListComponent {
}

onGetRoutesByName() {
this.currentPageNumber = 1;
this.router.navigate(
[],
{
relativeTo: this.activatedRoute,
queryParams: {routeName: this.routeNameToSearch},
queryParams: {page: this.currentPageNumber, routeName: this.routeNameToSearch},
queryParamsHandling: 'merge',
}
);
Expand All @@ -99,7 +100,9 @@ export class RouteListComponent {

onClearFilters() {
this.routeNameToSearch = "";
this.currentPageNumber = 1;
this.getRoutes();
this.onPageChanged()
}

showCurrentPageNumber() {
Expand Down

0 comments on commit 17494e3

Please sign in to comment.