diff options
Diffstat (limited to 'client/src/app/shared/shared-moderation/video-block.service.ts')
-rw-r--r-- | client/src/app/shared/shared-moderation/video-block.service.ts | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/client/src/app/shared/shared-moderation/video-block.service.ts b/client/src/app/shared/shared-moderation/video-block.service.ts index c22ceefcc..5dfb0d7d4 100644 --- a/client/src/app/shared/shared-moderation/video-block.service.ts +++ b/client/src/app/shared/shared-moderation/video-block.service.ts | |||
@@ -63,16 +63,20 @@ export class VideoBlockService { | |||
63 | ) | 63 | ) |
64 | } | 64 | } |
65 | 65 | ||
66 | blockVideo (videoId: number, reason: string, unfederate: boolean) { | 66 | blockVideo (options: { |
67 | const body = { | 67 | videoId: number |
68 | unfederate, | 68 | reason?: string |
69 | reason | 69 | unfederate: boolean |
70 | } | 70 | }[]) { |
71 | return observableFrom(options) | ||
72 | .pipe( | ||
73 | concatMap(({ videoId, unfederate, reason }) => { | ||
74 | const body = { unfederate, reason } | ||
71 | 75 | ||
72 | return this.authHttp.post(VideoBlockService.BASE_VIDEOS_URL + videoId + '/blacklist', body) | 76 | return this.authHttp.post(VideoBlockService.BASE_VIDEOS_URL + videoId + '/blacklist', body) |
73 | .pipe( | 77 | }), |
74 | map(this.restExtractor.extractDataBool), | 78 | toArray(), |
75 | catchError(res => this.restExtractor.handleError(res)) | 79 | catchError(res => this.restExtractor.handleError(res)) |
76 | ) | 80 | ) |
77 | } | 81 | } |
78 | } | 82 | } |