aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/shared/blocklist/blocklist.service.ts
diff options
context:
space:
mode:
authorRigel Kent <sendmemail@rigelk.eu>2020-04-19 14:11:40 +0200
committerRigel Kent <par@rigelk.eu>2020-05-01 16:41:02 +0200
commite0a929179a9dc76e035ca7fda2b61d5ff46afbc5 (patch)
tree1e6615c612ad6995dcb1c3619342dbbc7db35034 /client/src/app/shared/blocklist/blocklist.service.ts
parentaeb1bed9835b3b092832160245080d4023c14d91 (diff)
downloadPeerTube-e0a929179a9dc76e035ca7fda2b61d5ff46afbc5.tar.gz
PeerTube-e0a929179a9dc76e035ca7fda2b61d5ff46afbc5.tar.zst
PeerTube-e0a929179a9dc76e035ca7fda2b61d5ff46afbc5.zip
Add filter inputs for blacklisted videos and muted accounts/servers
Diffstat (limited to 'client/src/app/shared/blocklist/blocklist.service.ts')
-rw-r--r--client/src/app/shared/blocklist/blocklist.service.ts12
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)),