]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/videos/shared/video.service.ts
Client: better confirm box for a beautiful world
[github/Chocobozzz/PeerTube.git] / client / src / app / videos / shared / video.service.ts
index 9d79b2f5ea278c034be0a7b2a0b4dd07f1199201..7094d9a34210e4e7498e426adcec6b240379de1c 100644 (file)
@@ -55,6 +55,17 @@ export class VideoService {
                     .catch((res) => this.restExtractor.handleError(res));
   }
 
+  reportVideo(id: string, reason: string) {
+    const body = {
+      reason
+    };
+    const url = VideoService.BASE_VIDEO_URL + id + '/abuse';
+
+    return this.authHttp.post(url, body)
+                    .map(this.restExtractor.extractDataBool)
+                    .catch((res) => this.restExtractor.handleError(res));
+  }
+
   private extractVideos(result: ResultList) {
     const videosJson = result.data;
     const totalVideos = result.total;