videoId: number | string,
componentPagination: ComponentPagination,
sort: VideoSortField
- }): Observable<{ comments: VideoComment[], totalComments: number}> {
+ }): Observable<ResultList<VideoComment>> {
const { videoId, componentPagination, sort } = parameters
const pagination = this.restService.componentPaginationToRestPagination(componentPagination)
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<ResultList<VideoComment>>(url, { params })
.pipe(
- map(this.extractVideoComments),
+ map(result => this.extractVideoComments(result)),
catchError(err => this.restExtractor.handleError(err))
)
}
comments.push(new VideoComment(videoCommentJson))
}
- return { comments, totalComments }
+ return { data: comments, total: totalComments }
}
private extractVideoCommentTree (tree: VideoCommentThreadTree) {