diff options
Diffstat (limited to 'client/src/app/+video-channels')
-rw-r--r-- | client/src/app/+video-channels/video-channels.component.ts | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/client/src/app/+video-channels/video-channels.component.ts b/client/src/app/+video-channels/video-channels.component.ts index 5eca64fb5..09541b370 100644 --- a/client/src/app/+video-channels/video-channels.component.ts +++ b/client/src/app/+video-channels/video-channels.component.ts | |||
@@ -2,6 +2,8 @@ import { Component, OnInit } from '@angular/core' | |||
2 | import { ActivatedRoute } from '@angular/router' | 2 | import { ActivatedRoute } from '@angular/router' |
3 | import { VideoChannel } from '@app/shared/video-channel/video-channel.model' | 3 | import { VideoChannel } from '@app/shared/video-channel/video-channel.model' |
4 | import { VideoChannelService } from '@app/shared/video-channel/video-channel.service' | 4 | import { VideoChannelService } from '@app/shared/video-channel/video-channel.service' |
5 | import { RestExtractor } from '@app/shared' | ||
6 | import { catchError } from 'rxjs/operators' | ||
5 | 7 | ||
6 | @Component({ | 8 | @Component({ |
7 | templateUrl: './video-channels.component.html', | 9 | templateUrl: './video-channels.component.html', |
@@ -12,13 +14,15 @@ export class VideoChannelsComponent implements OnInit { | |||
12 | 14 | ||
13 | constructor ( | 15 | constructor ( |
14 | private route: ActivatedRoute, | 16 | private route: ActivatedRoute, |
15 | private videoChannelService: VideoChannelService | 17 | private videoChannelService: VideoChannelService, |
18 | private restExtractor: RestExtractor | ||
16 | ) {} | 19 | ) {} |
17 | 20 | ||
18 | ngOnInit () { | 21 | ngOnInit () { |
19 | const videoChannelId = this.route.snapshot.params['videoChannelId'] | 22 | const videoChannelId = this.route.snapshot.params['videoChannelId'] |
20 | 23 | ||
21 | this.videoChannelService.getVideoChannel(videoChannelId) | 24 | this.videoChannelService.getVideoChannel(videoChannelId) |
25 | .pipe(catchError(err => this.restExtractor.redirectTo404IfNotFound(err, [ 400, 404 ]))) | ||
22 | .subscribe(videoChannel => this.videoChannel = videoChannel) | 26 | .subscribe(videoChannel => this.videoChannel = videoChannel) |
23 | } | 27 | } |
24 | } | 28 | } |