aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/shared/video-abuse/video-abuse.service.ts
diff options
context:
space:
mode:
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.ts23
1 files changed, 21 insertions, 2 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 6fab3ef43..61b7e1b98 100644
--- a/client/src/app/shared/video-abuse/video-abuse.service.ts
+++ b/client/src/app/shared/video-abuse/video-abuse.service.ts
@@ -3,7 +3,7 @@ import { HttpClient, HttpParams } from '@angular/common/http'
3import { Injectable } from '@angular/core' 3import { Injectable } from '@angular/core'
4import { SortMeta } from 'primeng/components/common/sortmeta' 4import { SortMeta } from 'primeng/components/common/sortmeta'
5import { Observable } from 'rxjs' 5import { Observable } from 'rxjs'
6import { ResultList, VideoAbuse } from '../../../../../shared' 6import { ResultList, VideoAbuse, VideoAbuseUpdate } from '../../../../../shared'
7import { environment } from '../../../environments/environment' 7import { environment } from '../../../environments/environment'
8import { RestExtractor, RestPagination, RestService } from '../rest' 8import { RestExtractor, RestPagination, RestService } from '../rest'
9 9
@@ -42,4 +42,23 @@ export class VideoAbuseService {
42 catchError(res => this.restExtractor.handleError(res)) 42 catchError(res => this.restExtractor.handleError(res))
43 ) 43 )
44 } 44 }
45} 45
46 updateVideoAbuse (videoAbuse: VideoAbuse, abuseUpdate: VideoAbuseUpdate) {
47 const url = VideoAbuseService.BASE_VIDEO_ABUSE_URL + videoAbuse.video.uuid + '/abuse/' + videoAbuse.id
48
49 return this.authHttp.put(url, abuseUpdate)
50 .pipe(
51 map(this.restExtractor.extractDataBool),
52 catchError(res => this.restExtractor.handleError(res))
53 )
54 }
55
56 removeVideoAbuse (videoAbuse: VideoAbuse) {
57 const url = VideoAbuseService.BASE_VIDEO_ABUSE_URL + videoAbuse.video.uuid + '/abuse/' + videoAbuse.id
58
59 return this.authHttp.delete(url)
60 .pipe(
61 map(this.restExtractor.extractDataBool),
62 catchError(res => this.restExtractor.handleError(res))
63 )
64 }}