aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/shared/users
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-01-08 12:53:09 +0100
committerChocobozzz <me@florianbigard.com>2018-01-08 12:53:09 +0100
commitce5496d6a31b9617aba67970f5dc135e73335234 (patch)
treeb5d2578f4618b71632e92838c3ceae36aa102798 /client/src/app/shared/users
parent108af66140713c4beec681a71d360ab788226528 (diff)
downloadPeerTube-ce5496d6a31b9617aba67970f5dc135e73335234.tar.gz
PeerTube-ce5496d6a31b9617aba67970f5dc135e73335234.tar.zst
PeerTube-ce5496d6a31b9617aba67970f5dc135e73335234.zip
Support video quota on client
Diffstat (limited to 'client/src/app/shared/users')
-rw-r--r--client/src/app/shared/users/user.model.ts6
-rw-r--r--client/src/app/shared/users/user.service.ts5
2 files changed, 8 insertions, 3 deletions
diff --git a/client/src/app/shared/users/user.model.ts b/client/src/app/shared/users/user.model.ts
index 83aae4463..4a94b032d 100644
--- a/client/src/app/shared/users/user.model.ts
+++ b/client/src/app/shared/users/user.model.ts
@@ -60,4 +60,10 @@ export class User implements UserServerModel {
60 getAvatarUrl () { 60 getAvatarUrl () {
61 return Account.GET_ACCOUNT_AVATAR_URL(this.account) 61 return Account.GET_ACCOUNT_AVATAR_URL(this.account)
62 } 62 }
63
64 patch (obj: UserServerModel) {
65 for (const key of Object.keys(obj)) {
66 this[key] = obj[key]
67 }
68 }
63} 69}
diff --git a/client/src/app/shared/users/user.service.ts b/client/src/app/shared/users/user.service.ts
index 58ddaa5ee..742fb0728 100644
--- a/client/src/app/shared/users/user.service.ts
+++ b/client/src/app/shared/users/user.service.ts
@@ -48,11 +48,10 @@ export class UserService {
48 .catch(res => this.restExtractor.handleError(res)) 48 .catch(res => this.restExtractor.handleError(res))
49 } 49 }
50 50
51 getMyInformation () { 51 getMyVideoQuotaUsed () {
52 const url = UserService.BASE_USERS_URL + 'me' 52 const url = UserService.BASE_USERS_URL + '/me/video-quota-used'
53 53
54 return this.authHttp.get(url) 54 return this.authHttp.get(url)
55 .map((userHash: any) => new User(userHash))
56 .catch(res => this.restExtractor.handleError(res)) 55 .catch(res => this.restExtractor.handleError(res))
57 } 56 }
58} 57}