aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/shared/users/user.model.ts
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/app/shared/users/user.model.ts')
-rw-r--r--client/src/app/shared/users/user.model.ts34
1 files changed, 17 insertions, 17 deletions
diff --git a/client/src/app/shared/users/user.model.ts b/client/src/app/shared/users/user.model.ts
index d4695ab67..1c2b481e3 100644
--- a/client/src/app/shared/users/user.model.ts
+++ b/client/src/app/shared/users/user.model.ts
@@ -1,33 +1,33 @@
1import { User as UserServerModel, UserRole } from '../../../../../shared'; 1import { User as UserServerModel, UserRole } from '../../../../../shared'
2 2
3export class User implements UserServerModel { 3export class User implements UserServerModel {
4 id: number; 4 id: number
5 username: string; 5 username: string
6 email: string; 6 email: string
7 role: UserRole; 7 role: UserRole
8 displayNSFW: boolean; 8 displayNSFW: boolean
9 createdAt: Date; 9 createdAt: Date
10 10
11 constructor(hash: { 11 constructor (hash: {
12 id: number, 12 id: number,
13 username: string, 13 username: string,
14 email: string, 14 email: string,
15 role: UserRole, 15 role: UserRole,
16 displayNSFW?: boolean, 16 displayNSFW?: boolean,
17 createdAt?: Date, 17 createdAt?: Date
18 }) { 18 }) {
19 this.id = hash.id; 19 this.id = hash.id
20 this.username = hash.username; 20 this.username = hash.username
21 this.email = hash.email; 21 this.email = hash.email
22 this.role = hash.role; 22 this.role = hash.role
23 this.displayNSFW = hash.displayNSFW; 23 this.displayNSFW = hash.displayNSFW
24 24
25 if (hash.createdAt) { 25 if (hash.createdAt) {
26 this.createdAt = hash.createdAt; 26 this.createdAt = hash.createdAt
27 } 27 }
28 } 28 }
29 29
30 isAdmin() { 30 isAdmin () {
31 return this.role === 'admin'; 31 return this.role === 'admin'
32 } 32 }
33} 33}