From be27ef3b4682c5639039474c39ee0d234d16f482 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Mon, 10 Feb 2020 14:25:38 +0100 Subject: Strict templates enabled --- .../videos/+video-watch/comment/video-comment.service.ts | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'client/src/app/videos/+video-watch/comment/video-comment.service.ts') 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 a81e5236a..0b0715390 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 @@ -7,13 +7,14 @@ import { FeedFormat, ResultList } from '../../../../../../shared/models' import { VideoComment as VideoCommentServerModel, VideoCommentCreate, - VideoCommentThreadTree + VideoCommentThreadTree as VideoCommentThreadTreeServerModel } from '../../../../../../shared/models/videos/video-comment.model' import { environment } from '../../../../environments/environment' import { RestExtractor, RestService } from '../../../shared/rest' import { ComponentPaginationLight } from '../../../shared/rest/component-pagination.model' import { CommentSortField } from '../../../shared/video/sort-field.type' import { VideoComment } from './video-comment.model' +import { VideoCommentThreadTree } from '@app/videos/+video-watch/comment/video-comment-thread-tree.model' @Injectable() export class VideoCommentService { @@ -76,9 +77,9 @@ export class VideoCommentService { const url = `${VideoCommentService.BASE_VIDEO_URL + videoId}/comment-threads/${threadId}` return this.authHttp - .get(url) + .get(url) .pipe( - map(tree => this.extractVideoCommentTree(tree as VideoCommentThreadTree)), + map(tree => this.extractVideoCommentTree(tree)), catchError(err => this.restExtractor.handleError(err)) ) } @@ -138,12 +139,12 @@ export class VideoCommentService { return { data: comments, total: totalComments } } - private extractVideoCommentTree (tree: VideoCommentThreadTree) { - if (!tree) return tree + private extractVideoCommentTree (tree: VideoCommentThreadTreeServerModel) { + if (!tree) return tree as VideoCommentThreadTree tree.comment = new VideoComment(tree.comment) tree.children.forEach(c => this.extractVideoCommentTree(c)) - return tree + return tree as VideoCommentThreadTree } } -- cgit v1.2.3