Skip to content

Commit

Permalink
[Angular] Using Entity 'Refresh list' button makes pagination links m…
Browse files Browse the repository at this point in the history
…ultiply requests
  • Loading branch information
qmonmert committed Jan 23, 2024
1 parent 19ff3b6 commit 63de6a4
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import { Component, inject, OnInit } from '@angular/core';
import { HttpHeaders } from '@angular/common/http';
<%_ } _%>
import { ActivatedRoute, Data, ParamMap, Router, RouterModule } from '@angular/router';
import { combineLatest<%_ if (!readOnly) { _%>, filter<%_ } _%>, Observable, switchMap, tap } from 'rxjs';
import { combineLatest<%_ if (!readOnly) { _%>, filter<%_ } _%>, Observable, switchMap, Subscription, tap } from 'rxjs';
<%_ if (!readOnly) { _%>
import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
<%_ } _%>
Expand Down Expand Up @@ -121,6 +121,7 @@ export class <%= componentName %> implements OnInit {
private static readonly NOT_SORTABLE_FIELDS_AFTER_SEARCH = [<%- notSortableFieldsAfterSearch %>];

<%_ } _%>
subscription: Subscription | null = null;
<%= entityInstancePlural %>?: I<%= entityAngularName %>[];
isLoading = false;

Expand Down Expand Up @@ -227,6 +228,9 @@ export class <%= componentName %> implements OnInit {

<%_ } _%>
load(): void {
if (this.subscription !== null) {
this.subscription.unsubscribe();
}
this.loadFromBackendWithRouteInformations().subscribe({
next: (res: EntityArrayResponseType) => {
this.onResponseSuccess(res);
Expand Down

0 comments on commit 63de6a4

Please sign in to comment.