aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/shared/users/user.service.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-05-16 11:00:57 +0200
committerChocobozzz <me@florianbigard.com>2018-05-16 11:06:33 +0200
commit5fcbd89841be29b373c6e4c8eeaa1f27414c8c7d (patch)
tree5d3623fc06281065b12ab9687fead7194b62cb3f /client/src/app/shared/users/user.service.ts
parent133592034881926dc2da63735fe7344bfedd9c31 (diff)
downloadPeerTube-5fcbd89841be29b373c6e4c8eeaa1f27414c8c7d.tar.gz
PeerTube-5fcbd89841be29b373c6e4c8eeaa1f27414c8c7d.tar.zst
PeerTube-5fcbd89841be29b373c6e4c8eeaa1f27414c8c7d.zip
Fix typings
Diffstat (limited to 'client/src/app/shared/users/user.service.ts')
-rw-r--r--client/src/app/shared/users/user.service.ts7
1 files changed, 4 insertions, 3 deletions
diff --git a/client/src/app/shared/users/user.service.ts b/client/src/app/shared/users/user.service.ts
index 4843be618..9fe6c8b60 100644
--- a/client/src/app/shared/users/user.service.ts
+++ b/client/src/app/shared/users/user.service.ts
@@ -1,9 +1,10 @@
1import { catchError, map } from 'rxjs/operators' 1import { catchError, map } from 'rxjs/operators'
2import { HttpClient } from '@angular/common/http' 2import { HttpClient } from '@angular/common/http'
3import { Injectable } from '@angular/core' 3import { Injectable } from '@angular/core'
4import { UserCreate, UserUpdateMe } from '../../../../../shared' 4import { UserCreate, UserUpdateMe, UserVideoQuota } from '../../../../../shared'
5import { environment } from '../../../environments/environment' 5import { environment } from '../../../environments/environment'
6import { RestExtractor } from '../rest' 6import { RestExtractor } from '../rest'
7import { Avatar } from '../../../../../shared/models/avatars/avatar.model'
7 8
8@Injectable() 9@Injectable()
9export class UserService { 10export class UserService {
@@ -41,7 +42,7 @@ export class UserService {
41 changeAvatar (avatarForm: FormData) { 42 changeAvatar (avatarForm: FormData) {
42 const url = UserService.BASE_USERS_URL + 'me/avatar/pick' 43 const url = UserService.BASE_USERS_URL + 'me/avatar/pick'
43 44
44 return this.authHttp.post(url, avatarForm) 45 return this.authHttp.post<{ avatar: Avatar }>(url, avatarForm)
45 .pipe(catchError(this.restExtractor.handleError)) 46 .pipe(catchError(this.restExtractor.handleError))
46 } 47 }
47 48
@@ -56,7 +57,7 @@ export class UserService {
56 getMyVideoQuotaUsed () { 57 getMyVideoQuotaUsed () {
57 const url = UserService.BASE_USERS_URL + '/me/video-quota-used' 58 const url = UserService.BASE_USERS_URL + '/me/video-quota-used'
58 59
59 return this.authHttp.get(url) 60 return this.authHttp.get<UserVideoQuota>(url)
60 .pipe(catchError(res => this.restExtractor.handleError(res))) 61 .pipe(catchError(res => this.restExtractor.handleError(res)))
61 } 62 }
62 63