diff options
Diffstat (limited to 'client/src/app/shared/video-abuse')
-rw-r--r-- | client/src/app/shared/video-abuse/video-abuse.service.ts | 13 |
1 files changed, 8 insertions, 5 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 700a30239..43f4674b1 100644 --- a/client/src/app/shared/video-abuse/video-abuse.service.ts +++ b/client/src/app/shared/video-abuse/video-abuse.service.ts | |||
@@ -3,9 +3,10 @@ import { HttpClient, HttpParams } from '@angular/common/http' | |||
3 | import { Injectable } from '@angular/core' | 3 | import { Injectable } from '@angular/core' |
4 | import { SortMeta } from 'primeng/api' | 4 | import { SortMeta } from 'primeng/api' |
5 | import { Observable } from 'rxjs' | 5 | import { Observable } from 'rxjs' |
6 | import { ResultList, VideoAbuse, VideoAbuseUpdate, VideoAbuseState } from '../../../../../shared' | 6 | import { ResultList, VideoAbuse, VideoAbuseCreate, VideoAbuseState, VideoAbuseUpdate } from '../../../../../shared' |
7 | import { environment } from '../../../environments/environment' | 7 | import { environment } from '../../../environments/environment' |
8 | import { RestExtractor, RestPagination, RestService } from '../rest' | 8 | import { RestExtractor, RestPagination, RestService } from '../rest' |
9 | import { omit } from 'lodash-es' | ||
9 | 10 | ||
10 | @Injectable() | 11 | @Injectable() |
11 | export class VideoAbuseService { | 12 | export class VideoAbuseService { |
@@ -51,7 +52,8 @@ export class VideoAbuseService { | |||
51 | } | 52 | } |
52 | }, | 53 | }, |
53 | searchReporter: { prefix: 'reporter:' }, | 54 | searchReporter: { prefix: 'reporter:' }, |
54 | searchReportee: { prefix: 'reportee:' } | 55 | searchReportee: { prefix: 'reportee:' }, |
56 | predefinedReason: { prefix: 'tag:' } | ||
55 | }) | 57 | }) |
56 | 58 | ||
57 | params = this.restService.addObjectParams(params, filters) | 59 | params = this.restService.addObjectParams(params, filters) |
@@ -63,9 +65,10 @@ export class VideoAbuseService { | |||
63 | ) | 65 | ) |
64 | } | 66 | } |
65 | 67 | ||
66 | reportVideo (id: number, reason: string) { | 68 | reportVideo (parameters: { id: number } & VideoAbuseCreate) { |
67 | const url = VideoAbuseService.BASE_VIDEO_ABUSE_URL + id + '/abuse' | 69 | const url = VideoAbuseService.BASE_VIDEO_ABUSE_URL + parameters.id + '/abuse' |
68 | const body = { reason } | 70 | |
71 | const body = omit(parameters, [ 'id' ]) | ||
69 | 72 | ||
70 | return this.authHttp.post(url, body) | 73 | return this.authHttp.post(url, body) |
71 | .pipe( | 74 | .pipe( |