X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=client%2Fsrc%2Fapp%2Fvideos%2F%2Bvideo-watch%2Fcomment%2Fvideo-comment.service.ts;h=550d42fa86552c65a2b100ff8691a6b4a26c2f14;hb=e8f902c05cb35f6d5e9b75a23ddabd51c220a976;hp=eb608a1a36a9cec2ddfe57d03dee0642af3c23e7;hpb=93cae47925e4dd68b7d34a41927b2740b4fab1b4;p=github%2FChocobozzz%2FPeerTube.git diff --git a/client/src/app/videos/+video-watch/comment/video-comment.service.ts b/client/src/app/videos/+video-watch/comment/video-comment.service.ts index eb608a1a3..550d42fa8 100644 --- a/client/src/app/videos/+video-watch/comment/video-comment.service.ts +++ b/client/src/app/videos/+video-watch/comment/video-comment.service.ts @@ -52,7 +52,7 @@ export class VideoCommentService { videoId: number | string, componentPagination: ComponentPagination, sort: VideoSortField - }): Observable<{ comments: VideoComment[], totalComments: number}> { + }): Observable> { const { videoId, componentPagination, sort } = parameters const pagination = this.restService.componentPaginationToRestPagination(componentPagination) @@ -61,10 +61,9 @@ export class VideoCommentService { params = this.restService.addRestGetParams(params, pagination, sort) const url = VideoCommentService.BASE_VIDEO_URL + videoId + '/comment-threads' - return this.authHttp - .get(url, { params }) + return this.authHttp.get>(url, { params }) .pipe( - map(this.extractVideoComments), + map(result => this.extractVideoComments(result)), catchError(err => this.restExtractor.handleError(err)) ) } @@ -136,7 +135,7 @@ export class VideoCommentService { comments.push(new VideoComment(videoCommentJson)) } - return { comments, totalComments } + return { data: comments, total: totalComments } } private extractVideoCommentTree (tree: VideoCommentThreadTree) {