]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame - client/src/app/+accounts/accounts.component.ts
Fix markdown links truncating
[github/Chocobozzz/PeerTube.git] / client / src / app / +accounts / accounts.component.ts
CommitLineData
0626e7af
C
1import { Component, OnInit } from '@angular/core'
2import { ActivatedRoute } from '@angular/router'
3import { AccountService } from '@app/shared/account/account.service'
4import { Account } from '@app/shared/account/account.model'
a51bad1a
C
5import { RestExtractor } from '@app/shared'
6import { catchError } from 'rxjs/operators'
0626e7af
C
7
8@Component({
170726f5
C
9 templateUrl: './accounts.component.html',
10 styleUrls: [ './accounts.component.scss' ]
0626e7af 11})
170726f5 12export class AccountsComponent implements OnInit {
6b738c7a 13 account: Account
0626e7af
C
14
15 constructor (
16 private route: ActivatedRoute,
a51bad1a
C
17 private accountService: AccountService,
18 private restExtractor: RestExtractor
0626e7af
C
19 ) {}
20
21 ngOnInit () {
d14a9532 22 const accountId = this.route.snapshot.params['accountId']
0626e7af
C
23
24 this.accountService.getAccount(accountId)
a51bad1a 25 .pipe(catchError(err => this.restExtractor.redirectTo404IfNotFound(err, [ 400, 404 ])))
0626e7af
C
26 .subscribe(account => this.account = account)
27 }
0626e7af 28}