From eacb25c4366bcc8fba20f98f93f004fabc6d5578 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 8 Aug 2018 17:36:10 +0200 Subject: Add reason when banning a user --- client/src/app/shared/users/user.model.ts | 35 +++++++++++++------------------ 1 file changed, 14 insertions(+), 21 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 581ea7859..2748001d0 100644 --- a/client/src/app/shared/users/user.model.ts +++ b/client/src/app/shared/users/user.model.ts @@ -7,7 +7,6 @@ import { VideoChannel } from '../../../../../shared' import { NSFWPolicyType } from '../../../../../shared/models/videos/nsfw-policy.type' -import { Actor } from '@app/shared/actor/actor.model' import { Account } from '@app/shared/account/account.model' import { Avatar } from '../../../../../shared/models/avatars/avatar.model' @@ -22,6 +21,9 @@ export type UserConstructorHash = { createdAt?: Date, account?: AccountServerModel, videoChannels?: VideoChannel[] + + blocked?: boolean + blockedReason?: string } export class User implements UserServerModel { id: number @@ -35,35 +37,26 @@ export class User implements UserServerModel { videoChannels: VideoChannel[] createdAt: Date + blocked: boolean + blockedReason?: string + constructor (hash: UserConstructorHash) { this.id = hash.id this.username = hash.username this.email = hash.email this.role = hash.role + this.videoChannels = hash.videoChannels + this.videoQuota = hash.videoQuota + this.nsfwPolicy = hash.nsfwPolicy + this.autoPlayVideo = hash.autoPlayVideo + this.createdAt = hash.createdAt + this.blocked = hash.blocked + this.blockedReason = hash.blockedReason + if (hash.account !== undefined) { this.account = new Account(hash.account) } - - if (hash.videoChannels !== undefined) { - this.videoChannels = hash.videoChannels - } - - if (hash.videoQuota !== undefined) { - this.videoQuota = hash.videoQuota - } - - if (hash.nsfwPolicy !== undefined) { - this.nsfwPolicy = hash.nsfwPolicy - } - - if (hash.autoPlayVideo !== undefined) { - this.autoPlayVideo = hash.autoPlayVideo - } - - if (hash.createdAt !== undefined) { - this.createdAt = hash.createdAt - } } get accountAvatarUrl () { -- cgit v1.2.3