From ce5496d6a31b9617aba67970f5dc135e73335234 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Mon, 8 Jan 2018 12:53:09 +0100 Subject: Support video quota on client --- client/src/app/shared/users/user.model.ts | 6 ++++++ client/src/app/shared/users/user.service.ts | 5 ++--- 2 files changed, 8 insertions(+), 3 deletions(-) (limited to 'client/src/app/shared/users') 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 { getAvatarUrl () { return Account.GET_ACCOUNT_AVATAR_URL(this.account) } + + patch (obj: UserServerModel) { + for (const key of Object.keys(obj)) { + this[key] = obj[key] + } + } } 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 { .catch(res => this.restExtractor.handleError(res)) } - getMyInformation () { - const url = UserService.BASE_USERS_URL + 'me' + getMyVideoQuotaUsed () { + const url = UserService.BASE_USERS_URL + '/me/video-quota-used' return this.authHttp.get(url) - .map((userHash: any) => new User(userHash)) .catch(res => this.restExtractor.handleError(res)) } } -- cgit v1.2.3