aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/shared/account
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-05-15 11:55:51 +0200
committerChocobozzz <me@florianbigard.com>2018-05-16 09:42:54 +0200
commitdb400f447a9f7aae1c56fa25396e93069744483f (patch)
treef45af832a5d3f4eebafd2f885b7413d9f84fa374 /client/src/app/shared/account
parent54c3a22faa04bf13eea37f39be9149fc5eb95737 (diff)
downloadPeerTube-db400f447a9f7aae1c56fa25396e93069744483f.tar.gz
PeerTube-db400f447a9f7aae1c56fa25396e93069744483f.tar.zst
PeerTube-db400f447a9f7aae1c56fa25396e93069744483f.zip
Upgrade to rxjs 6
Diffstat (limited to 'client/src/app/shared/account')
-rw-r--r--client/src/app/shared/account/account.service.ts18
1 files changed, 8 insertions, 10 deletions
diff --git a/client/src/app/shared/account/account.service.ts b/client/src/app/shared/account/account.service.ts
index 8c66ae04a..20e52d946 100644
--- a/client/src/app/shared/account/account.service.ts
+++ b/client/src/app/shared/account/account.service.ts
@@ -1,14 +1,11 @@
1import { map, tap, catchError } from 'rxjs/operators'
1import { Injectable } from '@angular/core' 2import { Injectable } from '@angular/core'
2import 'rxjs/add/operator/catch'
3import 'rxjs/add/operator/map'
4import { environment } from '../../../environments/environment' 3import { environment } from '../../../environments/environment'
5import { Observable } from 'rxjs/Observable' 4import { Observable, ReplaySubject } from 'rxjs'
6import { Account } from '@app/shared/account/account.model' 5import { Account } from '@app/shared/account/account.model'
7import { RestExtractor } from '@app/shared/rest/rest-extractor.service' 6import { RestExtractor } from '@app/shared/rest/rest-extractor.service'
8import { RestService } from '@app/shared/rest/rest.service'
9import { HttpClient } from '@angular/common/http' 7import { HttpClient } from '@angular/common/http'
10import { Account as ServerAccount } from '../../../../../shared/models/actors/account.model' 8import { Account as ServerAccount } from '../../../../../shared/models/actors/account.model'
11import { ReplaySubject } from 'rxjs/ReplaySubject'
12 9
13@Injectable() 10@Injectable()
14export class AccountService { 11export class AccountService {
@@ -18,14 +15,15 @@ export class AccountService {
18 15
19 constructor ( 16 constructor (
20 private authHttp: HttpClient, 17 private authHttp: HttpClient,
21 private restExtractor: RestExtractor, 18 private restExtractor: RestExtractor
22 private restService: RestService
23 ) {} 19 ) {}
24 20
25 getAccount (id: number): Observable<Account> { 21 getAccount (id: number): Observable<Account> {
26 return this.authHttp.get<ServerAccount>(AccountService.BASE_ACCOUNT_URL + id) 22 return this.authHttp.get<ServerAccount>(AccountService.BASE_ACCOUNT_URL + id)
27 .map(accountHash => new Account(accountHash)) 23 .pipe(
28 .do(account => this.accountLoaded.next(account)) 24 map(accountHash => new Account(accountHash)),
29 .catch((res) => this.restExtractor.handleError(res)) 25 tap(account => this.accountLoaded.next(account)),
26 catchError(res => this.restExtractor.handleError(res))
27 )
30 } 28 }
31} 29}