aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/videos/video-watch/video-watch.component.ts
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/app/videos/video-watch/video-watch.component.ts')
-rw-r--r--client/src/app/videos/video-watch/video-watch.component.ts42
1 files changed, 22 insertions, 20 deletions
diff --git a/client/src/app/videos/video-watch/video-watch.component.ts b/client/src/app/videos/video-watch/video-watch.component.ts
index f582df45c..07b2a1d1f 100644
--- a/client/src/app/videos/video-watch/video-watch.component.ts
+++ b/client/src/app/videos/video-watch/video-watch.component.ts
@@ -171,41 +171,43 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
171 171
172 removeVideo(event: Event) { 172 removeVideo(event: Event) {
173 event.preventDefault(); 173 event.preventDefault();
174
174 this.confirmService.confirm('Do you really want to delete this video?', 'Delete').subscribe( 175 this.confirmService.confirm('Do you really want to delete this video?', 'Delete').subscribe(
175 res => { 176 res => {
176 if (res === false) return; 177 if (res === false) return;
177 178
178 this.videoService.removeVideo(this.video.id) 179 this.videoService.removeVideo(this.video.id)
179 .subscribe( 180 .subscribe(
180 status => { 181 status => {
181 this.notificationsService.success('Success', `Video ${this.video.name} deleted.`) 182 this.notificationsService.success('Success', `Video ${this.video.name} deleted.`);
182 // Go back to the video-list. 183 // Go back to the video-list.
183 this.router.navigate(['/videos/list']) 184 this.router.navigate(['/videos/list']);
184 }, 185 },
185 186
186 error => this.notificationsService.error('Error', error.text) 187 error => this.notificationsService.error('Error', error.text)
187 ); 188 );
188 } 189 }
189 ); 190 );
190 } 191 }
191 192
192 blacklistVideo(event: Event) { 193 blacklistVideo(event: Event) {
193 event.preventDefault() 194 event.preventDefault();
195
194 this.confirmService.confirm('Do you really want to blacklist this video ?', 'Blacklist').subscribe( 196 this.confirmService.confirm('Do you really want to blacklist this video ?', 'Blacklist').subscribe(
195 res => { 197 res => {
196 if (res === false) return; 198 if (res === false) return;
197 199
198 this.videoService.blacklistVideo(this.video.id) 200 this.videoService.blacklistVideo(this.video.id)
199 .subscribe( 201 .subscribe(
200 status => { 202 status => {
201 this.notificationsService.success('Success', `Video ${this.video.name} had been blacklisted.`) 203 this.notificationsService.success('Success', `Video ${this.video.name} had been blacklisted.`);
202 this.router.navigate(['/videos/list']) 204 this.router.navigate(['/videos/list']);
203 }, 205 },
204 206
205 error => this.notificationsService.error('Error', error.text) 207 error => this.notificationsService.error('Error', error.text)
206 ) 208 );
207 } 209 }
208 ) 210 );
209 } 211 }
210 212
211 showReportModal(event: Event) { 213 showReportModal(event: Event) {