]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/shared/video/video.service.ts
Fix typings
[github/Chocobozzz/PeerTube.git] / client / src / app / shared / video / video.service.ts
index f57cb6d6d8bca820924679a4fb41b7b944452d67..5b8e2467a6c5eb8e9d29f47b13b6a1992b4c7324 100644 (file)
@@ -48,7 +48,7 @@ export class VideoService {
                )
   }
 
-  viewVideo (uuid: string): Observable<VideoDetails> {
+  viewVideo (uuid: string): Observable<boolean> {
     return this.authHttp.post(this.getVideoViewUrl(uuid), {})
                .pipe(
                  map(this.restExtractor.extractDataBool),
@@ -92,7 +92,7 @@ export class VideoService {
     const req = new HttpRequest('POST', VideoService.BASE_VIDEO_URL + 'upload', video, { reportProgress: true })
 
     return this.authHttp
-               .request(req)
+               .request<{ video: { id: number, uuid: string} }>(req)
                .pipe(catchError(this.restExtractor.handleError))
   }
 
@@ -265,11 +265,10 @@ export class VideoService {
     return this.setVideoRate(id, 'none')
   }
 
-  getUserVideoRating (id: number): Observable<UserVideoRate> {
+  getUserVideoRating (id: number) {
     const url = UserService.BASE_USERS_URL + 'me/videos/' + id + '/rating'
 
-    return this.authHttp
-               .get(url)
+    return this.authHttp.get<UserVideoRate>(url)
                .pipe(catchError(res => this.restExtractor.handleError(res)))
   }