aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/videos/+video-watch/comment/video-comment.service.ts
diff options
context:
space:
mode:
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.ts7
1 files changed, 5 insertions, 2 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 c42f55496..14d32b1aa 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
@@ -2,6 +2,7 @@ import { HttpClient, HttpParams } from '@angular/common/http'
2import { Injectable } from '@angular/core' 2import { Injectable } from '@angular/core'
3import 'rxjs/add/operator/catch' 3import 'rxjs/add/operator/catch'
4import 'rxjs/add/operator/map' 4import 'rxjs/add/operator/map'
5import { immutableAssign, lineFeedToHtml } from '@app/shared/misc/utils'
5import { Observable } from 'rxjs/Observable' 6import { Observable } from 'rxjs/Observable'
6import { ResultList } from '../../../../../../shared/models' 7import { ResultList } from '../../../../../../shared/models'
7import { 8import {
@@ -26,16 +27,18 @@ export class VideoCommentService {
26 27
27 addCommentThread (videoId: number | string, comment: VideoCommentCreate) { 28 addCommentThread (videoId: number | string, comment: VideoCommentCreate) {
28 const url = VideoCommentService.BASE_VIDEO_URL + videoId + '/comment-threads' 29 const url = VideoCommentService.BASE_VIDEO_URL + videoId + '/comment-threads'
30 const normalizedComment = lineFeedToHtml(comment, 'text')
29 31
30 return this.authHttp.post(url, comment) 32 return this.authHttp.post(url, normalizedComment)
31 .map(data => this.extractVideoComment(data['comment'])) 33 .map(data => this.extractVideoComment(data['comment']))
32 .catch(this.restExtractor.handleError) 34 .catch(this.restExtractor.handleError)
33 } 35 }
34 36
35 addCommentReply (videoId: number | string, inReplyToCommentId: number, comment: VideoCommentCreate) { 37 addCommentReply (videoId: number | string, inReplyToCommentId: number, comment: VideoCommentCreate) {
36 const url = VideoCommentService.BASE_VIDEO_URL + videoId + '/comments/' + inReplyToCommentId 38 const url = VideoCommentService.BASE_VIDEO_URL + videoId + '/comments/' + inReplyToCommentId
39 const normalizedComment = lineFeedToHtml(comment, 'text')
37 40
38 return this.authHttp.post(url, comment) 41 return this.authHttp.post(url, normalizedComment)
39 .map(data => this.extractVideoComment(data['comment'])) 42 .map(data => this.extractVideoComment(data['comment']))
40 .catch(this.restExtractor.handleError) 43 .catch(this.restExtractor.handleError)
41 } 44 }