]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/shared/users/user.model.ts
Client: Handle NSFW video
[github/Chocobozzz/PeerTube.git] / client / src / app / shared / users / user.model.ts
index 0f34d4480faf4e176b5927b2d3269a6aee840200..f7859f495929ae257c767c76b6f5b0953580b1ad 100644 (file)
@@ -1,12 +1,25 @@
 export class User {
-  id: string;
+  id: number;
   username: string;
   role: string;
+  displayNSFW: boolean;
+  createdAt: Date;
 
-  constructor(hash: { id: string, username: string, role: string }) {
+  constructor(hash: {
+    id: number,
+    username: string,
+    role: string,
+    displayNSFW?: boolean,
+    createdAt?: Date,
+  }) {
     this.id = hash.id;
     this.username = hash.username;
     this.role = hash.role;
+    this.displayNSFW = hash.displayNSFW;
+
+    if (hash.createdAt) {
+      this.createdAt = hash.createdAt;
+    }
   }
 
   isAdmin() {