From e0a929179a9dc76e035ca7fda2b61d5ff46afbc5 Mon Sep 17 00:00:00 2001 From: Rigel Kent Date: Sun, 19 Apr 2020 14:11:40 +0200 Subject: Add filter inputs for blacklisted videos and muted accounts/servers --- client/src/app/shared/blocklist/blocklist.service.ts | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'client/src/app/shared/blocklist') diff --git a/client/src/app/shared/blocklist/blocklist.service.ts b/client/src/app/shared/blocklist/blocklist.service.ts index c1f7312f0..5cf265bc1 100644 --- a/client/src/app/shared/blocklist/blocklist.service.ts +++ b/client/src/app/shared/blocklist/blocklist.service.ts @@ -76,10 +76,14 @@ export class BlocklistService { /*********************** Instance -> Account blocklist ***********************/ - getInstanceAccountBlocklist (pagination: RestPagination, sort: SortMeta) { + getInstanceAccountBlocklist (options: { pagination: RestPagination, sort: SortMeta, search: string }) { + const { pagination, sort, search } = options + let params = new HttpParams() params = this.restService.addRestGetParams(params, pagination, sort) + if (search) params = params.append('search', search) + return this.authHttp.get>(BlocklistService.BASE_SERVER_BLOCKLIST_URL + '/accounts', { params }) .pipe( map(res => this.restExtractor.convertResultListDateToHuman(res)), @@ -104,10 +108,14 @@ export class BlocklistService { /*********************** Instance -> Server blocklist ***********************/ - getInstanceServerBlocklist (pagination: RestPagination, sort: SortMeta) { + getInstanceServerBlocklist (options: { pagination: RestPagination, sort: SortMeta, search: string }) { + const { pagination, sort, search } = options + let params = new HttpParams() params = this.restService.addRestGetParams(params, pagination, sort) + if (search) params = params.append('search', search) + return this.authHttp.get>(BlocklistService.BASE_SERVER_BLOCKLIST_URL + '/servers', { params }) .pipe( map(res => this.restExtractor.convertResultListDateToHuman(res)), -- cgit v1.2.3