X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=client%2Fsrc%2Fapp%2Fshared%2Fshared-video-comment%2Fvideo-comment.service.ts;h=fd1cae7f89c17b46e2d2a62106699d761bba4037;hb=51353d9a035fb6b81f903a8b5f391292841649fd;hp=c5aeb3c12e86ec24e6df9b46b29d172e1adb3f21;hpb=c27463a603186b623500b03c6a56b330a6568350;p=github%2FChocobozzz%2FPeerTube.git diff --git a/client/src/app/shared/shared-video-comment/video-comment.service.ts b/client/src/app/shared/shared-video-comment/video-comment.service.ts index c5aeb3c12..fd1cae7f8 100644 --- a/client/src/app/shared/shared-video-comment/video-comment.service.ts +++ b/client/src/app/shared/shared-video-comment/video-comment.service.ts @@ -9,6 +9,7 @@ import { FeedFormat, ResultList, ThreadsResultList, + Video, VideoComment as VideoCommentServerModel, VideoCommentAdmin, VideoCommentCreate, @@ -36,8 +37,8 @@ export class VideoCommentService { return this.authHttp.post<{ comment: VideoCommentServerModel }>(url, normalizedComment) .pipe( - map(data => this.extractVideoComment(data.comment)), - catchError(err => this.restExtractor.handleError(err)) + map(data => this.extractVideoComment(data.comment)), + catchError(err => this.restExtractor.handleError(err)) ) } @@ -53,8 +54,8 @@ export class VideoCommentService { } getAdminVideoComments (options: { - pagination: RestPagination, - sort: SortMeta, + pagination: RestPagination + sort: SortMeta search?: string }): Observable> { const { pagination, sort, search } = options @@ -74,13 +75,13 @@ export class VideoCommentService { } getVideoCommentThreads (parameters: { - videoId: number | string, - componentPagination: ComponentPaginationLight, + videoId: number | string + componentPagination: ComponentPaginationLight sort: string }): Observable> { const { videoId, componentPagination, sort } = parameters - const pagination = this.restService.componentPaginationToRestPagination(componentPagination) + const pagination = this.restService.componentToRestPagination(componentPagination) let params = new HttpParams() params = this.restService.addRestGetParams(params, pagination, sort) @@ -94,7 +95,7 @@ export class VideoCommentService { } getVideoThreadComments (parameters: { - videoId: number | string, + videoId: number | string threadId: number }): Observable { const { videoId, threadId } = parameters @@ -127,7 +128,7 @@ export class VideoCommentService { ) } - getVideoCommentsFeeds (videoUUID?: string) { + getVideoCommentsFeeds (video: Pick) { const feeds = [ { format: FeedFormat.RSS, @@ -146,9 +147,9 @@ export class VideoCommentService { } ] - if (videoUUID !== undefined) { + if (video !== undefined) { for (const feed of feeds) { - feed.url += '?videoId=' + videoUUID + feed.url += '?videoId=' + video.uuid } }