From 76314386aeafdd6849b7b70c517779d6b2013473 Mon Sep 17 00:00:00 2001 From: Rigel Kent Date: Fri, 27 Mar 2020 15:19:03 +0100 Subject: Add overview of a user's actions in user-edit (#2558) --- client/src/app/shared/users/user.model.ts | 10 ++++++++++ client/src/app/shared/users/user.service.ts | 5 +++-- 2 files changed, 13 insertions(+), 2 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 a37cae749..76c57d2fb 100644 --- a/client/src/app/shared/users/user.model.ts +++ b/client/src/app/shared/users/user.model.ts @@ -51,6 +51,11 @@ export class User implements UserServerModel { videoQuotaDaily: number videoQuotaUsed?: number videoQuotaUsedDaily?: number + videosCount?: number + videoAbusesCount?: number + videoAbusesAcceptedCount?: number + videoAbusesCreatedCount?: number + videoCommentsCount?: number theme: string @@ -79,6 +84,11 @@ export class User implements UserServerModel { this.videoQuotaDaily = hash.videoQuotaDaily this.videoQuotaUsed = hash.videoQuotaUsed this.videoQuotaUsedDaily = hash.videoQuotaUsedDaily + this.videosCount = hash.videosCount + this.videoAbusesCount = hash.videoAbusesCount + this.videoAbusesAcceptedCount = hash.videoAbusesAcceptedCount + this.videoAbusesCreatedCount = hash.videoAbusesCreatedCount + this.videoCommentsCount = hash.videoCommentsCount this.nsfwPolicy = hash.nsfwPolicy this.webTorrentEnabled = hash.webTorrentEnabled diff --git a/client/src/app/shared/users/user.service.ts b/client/src/app/shared/users/user.service.ts index a79343646..5442a8453 100644 --- a/client/src/app/shared/users/user.service.ts +++ b/client/src/app/shared/users/user.service.ts @@ -234,8 +234,9 @@ export class UserService { return this.userCache[userId] } - getUser (userId: number) { - return this.authHttp.get(UserService.BASE_USERS_URL + userId) + getUser (userId: number, withStats = false) { + const params = new HttpParams().append('withStats', withStats + '') + return this.authHttp.get(UserService.BASE_USERS_URL + userId, { params }) .pipe(catchError(err => this.restExtractor.handleError(err))) } -- cgit v1.2.3