aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/shared/shared-video-comment
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2020-11-20 13:55:33 +0100
committerChocobozzz <me@florianbigard.com>2020-11-20 13:59:21 +0100
commit939917705fa3fa93ab7036b5e7e9aaf5f1d0023e (patch)
tree54e941e916a1da82f999fabb9b419287441d53fb /client/src/app/shared/shared-video-comment
parent4749078b8af8fdaf40dd35c9e2da7e681b9ea664 (diff)
downloadPeerTube-939917705fa3fa93ab7036b5e7e9aaf5f1d0023e.tar.gz
PeerTube-939917705fa3fa93ab7036b5e7e9aaf5f1d0023e.tar.zst
PeerTube-939917705fa3fa93ab7036b5e7e9aaf5f1d0023e.zip
Add ability to bulk delete comments
Diffstat (limited to 'client/src/app/shared/shared-video-comment')
-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 {