diff options
Diffstat (limited to 'client/src/app/shared/blocklist/blocklist.service.ts')
-rw-r--r-- | client/src/app/shared/blocklist/blocklist.service.ts | 12 |
1 files changed, 10 insertions, 2 deletions
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 { | |||
76 | 76 | ||
77 | /*********************** Instance -> Account blocklist ***********************/ | 77 | /*********************** Instance -> Account blocklist ***********************/ |
78 | 78 | ||
79 | getInstanceAccountBlocklist (pagination: RestPagination, sort: SortMeta) { | 79 | getInstanceAccountBlocklist (options: { pagination: RestPagination, sort: SortMeta, search: string }) { |
80 | const { pagination, sort, search } = options | ||
81 | |||
80 | let params = new HttpParams() | 82 | let params = new HttpParams() |
81 | params = this.restService.addRestGetParams(params, pagination, sort) | 83 | params = this.restService.addRestGetParams(params, pagination, sort) |
82 | 84 | ||
85 | if (search) params = params.append('search', search) | ||
86 | |||
83 | return this.authHttp.get<ResultList<AccountBlock>>(BlocklistService.BASE_SERVER_BLOCKLIST_URL + '/accounts', { params }) | 87 | return this.authHttp.get<ResultList<AccountBlock>>(BlocklistService.BASE_SERVER_BLOCKLIST_URL + '/accounts', { params }) |
84 | .pipe( | 88 | .pipe( |
85 | map(res => this.restExtractor.convertResultListDateToHuman(res)), | 89 | map(res => this.restExtractor.convertResultListDateToHuman(res)), |
@@ -104,10 +108,14 @@ export class BlocklistService { | |||
104 | 108 | ||
105 | /*********************** Instance -> Server blocklist ***********************/ | 109 | /*********************** Instance -> Server blocklist ***********************/ |
106 | 110 | ||
107 | getInstanceServerBlocklist (pagination: RestPagination, sort: SortMeta) { | 111 | getInstanceServerBlocklist (options: { pagination: RestPagination, sort: SortMeta, search: string }) { |
112 | const { pagination, sort, search } = options | ||
113 | |||
108 | let params = new HttpParams() | 114 | let params = new HttpParams() |
109 | params = this.restService.addRestGetParams(params, pagination, sort) | 115 | params = this.restService.addRestGetParams(params, pagination, sort) |
110 | 116 | ||
117 | if (search) params = params.append('search', search) | ||
118 | |||
111 | return this.authHttp.get<ResultList<ServerBlock>>(BlocklistService.BASE_SERVER_BLOCKLIST_URL + '/servers', { params }) | 119 | return this.authHttp.get<ResultList<ServerBlock>>(BlocklistService.BASE_SERVER_BLOCKLIST_URL + '/servers', { params }) |
112 | .pipe( | 120 | .pipe( |
113 | map(res => this.restExtractor.convertResultListDateToHuman(res)), | 121 | map(res => this.restExtractor.convertResultListDateToHuman(res)), |