From 4f5d045960b042eb27e10bac1bdaf1c074c9fa2a Mon Sep 17 00:00:00 2001 From: Rigel Kent Date: Thu, 23 Jul 2020 21:30:04 +0200 Subject: harmonize search for libraries --- .../shared-user-subscription/user-subscription.service.ts | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'client/src/app/shared/shared-user-subscription') diff --git a/client/src/app/shared/shared-user-subscription/user-subscription.service.ts b/client/src/app/shared/shared-user-subscription/user-subscription.service.ts index 732ed6bcb..eb1fdf91c 100644 --- a/client/src/app/shared/shared-user-subscription/user-subscription.service.ts +++ b/client/src/app/shared/shared-user-subscription/user-subscription.service.ts @@ -105,13 +105,18 @@ export class UserSubscriptionService { ) } - listSubscriptions (componentPagination: ComponentPaginationLight): Observable> { + listSubscriptions (parameters: { + pagination: ComponentPaginationLight + search: string + }): Observable> { + const { pagination, search } = parameters const url = UserSubscriptionService.BASE_USER_SUBSCRIPTIONS_URL - const pagination = this.restService.componentPaginationToRestPagination(componentPagination) + const restPagination = this.restService.componentPaginationToRestPagination(pagination) let params = new HttpParams() - params = this.restService.addRestGetParams(params, pagination) + params = this.restService.addRestGetParams(params, restPagination) + if (search) params = params.append('search', search) return this.authHttp.get>(url, { params }) .pipe( -- cgit v1.2.3