diff options
author | Chocobozzz <me@florianbigard.com> | 2020-11-20 13:55:33 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2020-11-20 13:59:21 +0100 |
commit | 939917705fa3fa93ab7036b5e7e9aaf5f1d0023e (patch) | |
tree | 54e941e916a1da82f999fabb9b419287441d53fb /client/src/app/shared | |
parent | 4749078b8af8fdaf40dd35c9e2da7e681b9ea664 (diff) | |
download | PeerTube-939917705fa3fa93ab7036b5e7e9aaf5f1d0023e.tar.gz PeerTube-939917705fa3fa93ab7036b5e7e9aaf5f1d0023e.tar.zst PeerTube-939917705fa3fa93ab7036b5e7e9aaf5f1d0023e.zip |
Add ability to bulk delete comments
Diffstat (limited to 'client/src/app/shared')
-rw-r--r-- | client/src/app/shared/shared-video-comment/video-comment.service.ts | 14 |
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 @@ | |||
1 | import { Observable } from 'rxjs' | 1 | import { SortMeta } from 'primeng/api' |
2 | import { catchError, map } from 'rxjs/operators' | 2 | import { from, Observable } from 'rxjs' |
3 | import { catchError, concatMap, map, toArray } from 'rxjs/operators' | ||
3 | import { HttpClient, HttpParams } from '@angular/common/http' | 4 | import { HttpClient, HttpParams } from '@angular/common/http' |
4 | import { Injectable } from '@angular/core' | 5 | import { Injectable } from '@angular/core' |
5 | import { ComponentPaginationLight, RestExtractor, RestPagination, RestService } from '@app/core' | 6 | import { ComponentPaginationLight, RestExtractor, RestPagination, RestService } from '@app/core' |
@@ -15,7 +16,6 @@ import { | |||
15 | import { environment } from '../../../environments/environment' | 16 | import { environment } from '../../../environments/environment' |
16 | import { VideoCommentThreadTree } from './video-comment-thread-tree.model' | 17 | import { VideoCommentThreadTree } from './video-comment-thread-tree.model' |
17 | import { VideoComment } from './video-comment.model' | 18 | import { VideoComment } from './video-comment.model' |
18 | import { SortMeta } from 'primeng/api' | ||
19 | 19 | ||
20 | @Injectable() | 20 | @Injectable() |
21 | export class VideoCommentService { | 21 | export 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 | { |