diff options
Diffstat (limited to 'client/src/app/shared/video-abuse/video-abuse.service.ts')
-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)), |