diff options
author | Rigel Kent <sendmemail@rigelk.eu> | 2020-04-18 10:00:19 +0200 |
---|---|---|
committer | Rigel Kent <par@rigelk.eu> | 2020-05-01 16:41:02 +0200 |
commit | 844db39ee56ff0dd59a96acfc68f10f9ac53000b (patch) | |
tree | e9b33b09c08465e73819cf189a112ec17b044349 /client/src/app/shared | |
parent | 36d0677ec95605eca0543712686c591fb8e6f3c1 (diff) | |
download | PeerTube-844db39ee56ff0dd59a96acfc68f10f9ac53000b.tar.gz PeerTube-844db39ee56ff0dd59a96acfc68f10f9ac53000b.tar.zst PeerTube-844db39ee56ff0dd59a96acfc68f10f9ac53000b.zip |
Add search for video, reporter and channel name fields
Diffstat (limited to 'client/src/app/shared')
-rw-r--r-- | client/src/app/shared/video-abuse/video-abuse.service.ts | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/client/src/app/shared/video-abuse/video-abuse.service.ts b/client/src/app/shared/video-abuse/video-abuse.service.ts index 61a328575..a39ad31d4 100644 --- a/client/src/app/shared/video-abuse/video-abuse.service.ts +++ b/client/src/app/shared/video-abuse/video-abuse.service.ts | |||
@@ -17,12 +17,19 @@ export class VideoAbuseService { | |||
17 | private restExtractor: RestExtractor | 17 | private restExtractor: RestExtractor |
18 | ) {} | 18 | ) {} |
19 | 19 | ||
20 | getVideoAbuses (pagination: RestPagination, sort: SortMeta): Observable<ResultList<VideoAbuse>> { | 20 | getVideoAbuses (options: { |
21 | pagination: RestPagination, | ||
22 | sort: SortMeta, | ||
23 | search?: string | ||
24 | }): Observable<ResultList<VideoAbuse>> { | ||
25 | const { pagination, sort, search } = options | ||
21 | const url = VideoAbuseService.BASE_VIDEO_ABUSE_URL + 'abuse' | 26 | const url = VideoAbuseService.BASE_VIDEO_ABUSE_URL + 'abuse' |
22 | 27 | ||
23 | let params = new HttpParams() | 28 | let params = new HttpParams() |
24 | params = this.restService.addRestGetParams(params, pagination, sort) | 29 | params = this.restService.addRestGetParams(params, pagination, sort) |
25 | 30 | ||
31 | if (search) params = params.append('search', search) | ||
32 | |||
26 | return this.authHttp.get<ResultList<VideoAbuse>>(url, { params }) | 33 | return this.authHttp.get<ResultList<VideoAbuse>>(url, { params }) |
27 | .pipe( | 34 | .pipe( |
28 | map(res => this.restExtractor.convertResultListDateToHuman(res)), | 35 | map(res => this.restExtractor.convertResultListDateToHuman(res)), |