diff options
Diffstat (limited to 'client/src/app/videos/+video-watch/comment/video-comment.service.ts')
-rw-r--r-- | client/src/app/videos/+video-watch/comment/video-comment.service.ts | 9 |
1 files changed, 4 insertions, 5 deletions
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 { | |||
52 | videoId: number | string, | 52 | videoId: number | string, |
53 | componentPagination: ComponentPagination, | 53 | componentPagination: ComponentPagination, |
54 | sort: VideoSortField | 54 | sort: VideoSortField |
55 | }): Observable<{ comments: VideoComment[], totalComments: number}> { | 55 | }): Observable<ResultList<VideoComment>> { |
56 | const { videoId, componentPagination, sort } = parameters | 56 | const { videoId, componentPagination, sort } = parameters |
57 | 57 | ||
58 | const pagination = this.restService.componentPaginationToRestPagination(componentPagination) | 58 | const pagination = this.restService.componentPaginationToRestPagination(componentPagination) |
@@ -61,10 +61,9 @@ export class VideoCommentService { | |||
61 | params = this.restService.addRestGetParams(params, pagination, sort) | 61 | params = this.restService.addRestGetParams(params, pagination, sort) |
62 | 62 | ||
63 | const url = VideoCommentService.BASE_VIDEO_URL + videoId + '/comment-threads' | 63 | const url = VideoCommentService.BASE_VIDEO_URL + videoId + '/comment-threads' |
64 | return this.authHttp | 64 | return this.authHttp.get<ResultList<VideoComment>>(url, { params }) |
65 | .get(url, { params }) | ||
66 | .pipe( | 65 | .pipe( |
67 | map(this.extractVideoComments), | 66 | map(result => this.extractVideoComments(result)), |
68 | catchError(err => this.restExtractor.handleError(err)) | 67 | catchError(err => this.restExtractor.handleError(err)) |
69 | ) | 68 | ) |
70 | } | 69 | } |
@@ -136,7 +135,7 @@ export class VideoCommentService { | |||
136 | comments.push(new VideoComment(videoCommentJson)) | 135 | comments.push(new VideoComment(videoCommentJson)) |
137 | } | 136 | } |
138 | 137 | ||
139 | return { comments, totalComments } | 138 | return { data: comments, total: totalComments } |
140 | } | 139 | } |
141 | 140 | ||
142 | private extractVideoCommentTree (tree: VideoCommentThreadTree) { | 141 | private extractVideoCommentTree (tree: VideoCommentThreadTree) { |