diff --git a/projects/admin/src/app/circulation/patron/ill-request/ill-request.component.ts b/projects/admin/src/app/circulation/patron/ill-request/ill-request.component.ts index 18006968b..16d661358 100644 --- a/projects/admin/src/app/circulation/patron/ill-request/ill-request.component.ts +++ b/projects/admin/src/app/circulation/patron/ill-request/ill-request.component.ts @@ -48,7 +48,7 @@ export class IllRequestComponent implements OnInit { switchMap((patron: any) => { return (!patron) ? of(null) - : this.illRequestApiService.getByPatronPid(patron.pid) + : this.illRequestApiService.getByPatronPid(patron.pid, {remove_archived: '1'}) } )); } diff --git a/projects/public-search/src/app/api/ill-request-api.service.ts b/projects/public-search/src/app/api/ill-request-api.service.ts index b660bc242..f1b944fc2 100644 --- a/projects/public-search/src/app/api/ill-request-api.service.ts +++ b/projects/public-search/src/app/api/ill-request-api.service.ts @@ -64,9 +64,10 @@ export class IllRequestApiService extends BaseApi { page: number, itemsPerPage: number = 10, headers = BaseApi.reroJsonheaders, - sort: string = '-created' + sort: string = '-created', + filters?: {[key: string]: string} ): Observable { - const query = `patron.pid:${patronPid} AND -status:denied AND -status:closed AND -loan_status:ITEM_RETURNED`; - return this._recordService.getRecords('ill_requests', query, page, itemsPerPage, undefined, undefined, headers, sort); + const query = `patron.pid:${patronPid}`; + return this._recordService.getRecords('ill_requests', query, page, itemsPerPage, undefined, filters, headers, sort); } } diff --git a/projects/public-search/src/app/patron-profile/patron-profile-ill-requests/patron-profile-ill-requests.component.ts b/projects/public-search/src/app/patron-profile/patron-profile-ill-requests/patron-profile-ill-requests.component.ts index 3c4496e3f..de6a166b7 100644 --- a/projects/public-search/src/app/patron-profile/patron-profile-ill-requests/patron-profile-ill-requests.component.ts +++ b/projects/public-search/src/app/patron-profile/patron-profile-ill-requests/patron-profile-ill-requests.component.ts @@ -17,7 +17,7 @@ import { Component, OnDestroy, OnInit } from '@angular/core'; import { marker as _ } from '@biesbjerg/ngx-translate-extract-marker'; import { Error, Record } from '@rero/ng-core'; -import { Paginator } from '@rero/shared'; +import { BaseApi, Paginator } from '@rero/shared'; import { Observable, Subscription } from 'rxjs'; import { IllRequestApiService } from '../../api/ill-request-api.service'; import { PatronProfileMenuService } from '../patron-profile-menu.service'; @@ -106,6 +106,9 @@ export class PatronProfileIllRequestsComponent implements OnInit, OnDestroy { private _illRequestQuery(page: number): Observable { const patronPid = this.patronProfileMenuService.currentPatron.pid; return this.illRequestApiService - .getPublicIllRequest(patronPid, page, this.paginator.getRecordsPerPage()); + .getPublicIllRequest( + patronPid, page, this.paginator.getRecordsPerPage(), + BaseApi.reroJsonheaders, '-created', {remove_archived: '1'} + ); } }