aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/shared/shared-video-comment/video-comment.service.ts
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/app/shared/shared-video-comment/video-comment.service.ts')
-rw-r--r--client/src/app/shared/shared-video-comment/video-comment.service.ts14
1 files changed, 11 insertions, 3 deletions
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 1ab996a76..c107a33ab 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
@@ -1,5 +1,6 @@
1import { Observable } from 'rxjs' 1import { SortMeta } from 'primeng/api'
2import { catchError, map } from 'rxjs/operators' 2import { from, Observable } from 'rxjs'
3import { catchError, concatMap, map, toArray } from 'rxjs/operators'
3import { HttpClient, HttpParams } from '@angular/common/http' 4import { HttpClient, HttpParams } from '@angular/common/http'
4import { Injectable } from '@angular/core' 5import { Injectable } from '@angular/core'
5import { ComponentPaginationLight, RestExtractor, RestPagination, RestService } from '@app/core' 6import { ComponentPaginationLight, RestExtractor, RestPagination, RestService } from '@app/core'
@@ -15,7 +16,6 @@ import {
15import { environment } from '../../../environments/environment' 16import { environment } from '../../../environments/environment'
16import { VideoCommentThreadTree } from './video-comment-thread-tree.model' 17import { VideoCommentThreadTree } from './video-comment-thread-tree.model'
17import { VideoComment } from './video-comment.model' 18import { VideoComment } from './video-comment.model'
18import { SortMeta } from 'primeng/api'
19 19
20@Injectable() 20@Injectable()
21export class VideoCommentService { 21export class VideoCommentService {
@@ -118,6 +118,14 @@ export class VideoCommentService {
118 ) 118 )
119 } 119 }
120 120
121 deleteVideoComments (comments: { videoId: number | string, commentId: number }[]) {
122 return from(comments)
123 .pipe(
124 concatMap(c => this.deleteVideoComment(c.videoId, c.commentId)),
125 toArray()
126 )
127 }
128
121 getVideoCommentsFeeds (videoUUID?: string) { 129 getVideoCommentsFeeds (videoUUID?: string) {
122 const feeds = [ 130 const feeds = [
123 { 131 {