add private groups

This commit is contained in:
Adolfo Reyna
2021-09-25 21:20:41 -07:00
parent 83941c59d5
commit 070912f2d3
7 changed files with 77 additions and 30 deletions
View File
-8
View File
@@ -1,8 +0,0 @@
User = require("./User.js")
class Gropu extends User {
constructor(){
super()
this.isGroup = true;
}
}
+11 -3
View File
@@ -16,10 +16,15 @@ class User {
this.following = info.following || [];
this.lastUpdate = info.lastUpdate || new Date();
this.newsFeedCache = info.newsFeedCache || [];
this.notifications = info.notifications || [];
//groupRelated
this.isGroup = info.isGroup || false;
this.isCourse = info.isCourse || false;
this.subscribed = info.subscribed || {};
this.notifications = info.notifications || [];
this.isPrivate = info.isPrivate || false;
this.subscribed = info.subscribed || {}; //Subscribed user to groups
this.pending = info.subscribed || {}; //Private groups require authorization
}
toObj(){
@@ -32,10 +37,13 @@ class User {
r.following = this.following;
r.lastUpdate = this.lastUpdate;
r.newsFeedCache = this.newsFeedCache;
r.notifications = this.notifications;
r.isGroup = this.isGroup;
r.isCourse = this.isCourse;
r.isPrivate = this.isPrivate;
r.subscribed = this.subscribed;
r.notifications = this.notifications;
r.pending = this.pending;
return r;
}