Skip to content

Commit

Permalink
Insert Change Page on List Route Versions
Browse files Browse the repository at this point in the history
  • Loading branch information
Andreu Pérez committed Jan 21, 2024
1 parent 816a6e5 commit efd28ac
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,5 @@ <h6 class="card-subtitle text-muted">Title</h6>
</div>
</div>
</div>
<ngb-pagination class="d-flex justify-content-center" [(page)]="page" [pageSize]="pageSize" [collectionSize]="totalRoutes" (pageChange)="changePage()">
</ngb-pagination>
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,21 @@ export class RouteVersionsListComponent implements OnInit {
});
}

changePage(): void {
this.routesPagedResource.customPage(
{pageParams: {page: this.page - 1, size: this.pageSize},
sort: {name: 'ASC'}}).subscribe(
(page: PagedResourceCollection<RouteVersion>) => {
this.routeVersions = page.resources;
this.routeVersions.map(routes => {
routes.getRelation('createdBy')
.subscribe((user: User) => {
routes.createdBy = user;
});
});
});
}

isRole(role: string): boolean {
return this.authenticationService.isRole(role);
}
Expand Down

0 comments on commit efd28ac

Please sign in to comment.