diff options
author | Chocobozzz <me@florianbigard.com> | 2018-05-31 11:35:01 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-05-31 14:24:13 +0200 |
commit | a51bad1accfade25916db0dadaeb879a182cf19b (patch) | |
tree | 128330863a1125be437cf8ba9bc0c6c529068520 /client/src/app/+accounts | |
parent | 351d5225d6a4fe6863f760f02454eac88f730607 (diff) | |
download | PeerTube-a51bad1accfade25916db0dadaeb879a182cf19b.tar.gz PeerTube-a51bad1accfade25916db0dadaeb879a182cf19b.tar.zst PeerTube-a51bad1accfade25916db0dadaeb879a182cf19b.zip |
Add 404 page
Diffstat (limited to 'client/src/app/+accounts')
-rw-r--r-- | client/src/app/+accounts/accounts.component.ts | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/client/src/app/+accounts/accounts.component.ts b/client/src/app/+accounts/accounts.component.ts index 0a52985da..24bde61ce 100644 --- a/client/src/app/+accounts/accounts.component.ts +++ b/client/src/app/+accounts/accounts.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 { AccountService } from '@app/shared/account/account.service' | 3 | import { AccountService } from '@app/shared/account/account.service' |
4 | import { Account } from '@app/shared/account/account.model' | 4 | import { Account } from '@app/shared/account/account.model' |
5 | import { RestExtractor } from '@app/shared' | ||
6 | import { catchError } from 'rxjs/operators' | ||
5 | 7 | ||
6 | @Component({ | 8 | @Component({ |
7 | templateUrl: './accounts.component.html', | 9 | templateUrl: './accounts.component.html', |
@@ -12,13 +14,15 @@ export class AccountsComponent implements OnInit { | |||
12 | 14 | ||
13 | constructor ( | 15 | constructor ( |
14 | private route: ActivatedRoute, | 16 | private route: ActivatedRoute, |
15 | private accountService: AccountService | 17 | private accountService: AccountService, |
18 | private restExtractor: RestExtractor | ||
16 | ) {} | 19 | ) {} |
17 | 20 | ||
18 | ngOnInit () { | 21 | ngOnInit () { |
19 | const accountId = this.route.snapshot.params['accountId'] | 22 | const accountId = this.route.snapshot.params['accountId'] |
20 | 23 | ||
21 | this.accountService.getAccount(accountId) | 24 | this.accountService.getAccount(accountId) |
25 | .pipe(catchError(err => this.restExtractor.redirectTo404IfNotFound(err, [ 400, 404 ]))) | ||
22 | .subscribe(account => this.account = account) | 26 | .subscribe(account => this.account = account) |
23 | } | 27 | } |
24 | } | 28 | } |