diff options
author | Rigel Kent <sendmemail@rigelk.eu> | 2020-04-19 14:11:40 +0200 |
---|---|---|
committer | Rigel Kent <par@rigelk.eu> | 2020-05-01 16:41:02 +0200 |
commit | e0a929179a9dc76e035ca7fda2b61d5ff46afbc5 (patch) | |
tree | 1e6615c612ad6995dcb1c3619342dbbc7db35034 /client/src/app/shared | |
parent | aeb1bed9835b3b092832160245080d4023c14d91 (diff) | |
download | PeerTube-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')
-rw-r--r-- | client/src/app/shared/blocklist/blocklist.service.ts | 12 | ||||
-rw-r--r-- | client/src/app/shared/video-blacklist/video-blacklist.service.ts | 14 |
2 files changed, 20 insertions, 6 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)), |
diff --git a/client/src/app/shared/video-blacklist/video-blacklist.service.ts b/client/src/app/shared/video-blacklist/video-blacklist.service.ts index 116177c4a..c0e13a651 100644 --- a/client/src/app/shared/video-blacklist/video-blacklist.service.ts +++ b/client/src/app/shared/video-blacklist/video-blacklist.service.ts | |||
@@ -19,13 +19,19 @@ export class VideoBlacklistService { | |||
19 | private restExtractor: RestExtractor | 19 | private restExtractor: RestExtractor |
20 | ) {} | 20 | ) {} |
21 | 21 | ||
22 | listBlacklist (pagination: RestPagination, sort: SortMeta, type?: VideoBlacklistType): Observable<ResultList<VideoBlacklist>> { | 22 | listBlacklist (options: { |
23 | pagination: RestPagination, | ||
24 | sort: SortMeta, | ||
25 | search?: string | ||
26 | type?: VideoBlacklistType | ||
27 | }): Observable<ResultList<VideoBlacklist>> { | ||
28 | const { pagination, sort, search, type } = options | ||
29 | |||
23 | let params = new HttpParams() | 30 | let params = new HttpParams() |
24 | params = this.restService.addRestGetParams(params, pagination, sort) | 31 | params = this.restService.addRestGetParams(params, pagination, sort) |
25 | 32 | ||
26 | if (type) { | 33 | if (search) params = params.append('search', search) |
27 | params = params.set('type', type.toString()) | 34 | if (type) params = params.append('type', type.toString()) |
28 | } | ||
29 | 35 | ||
30 | return this.authHttp.get<ResultList<VideoBlacklist>>(VideoBlacklistService.BASE_VIDEOS_URL + 'blacklist', { params }) | 36 | return this.authHttp.get<ResultList<VideoBlacklist>>(VideoBlacklistService.BASE_VIDEOS_URL + 'blacklist', { params }) |
31 | .pipe( | 37 | .pipe( |