Group Page corrected
This commit is contained in:
@@ -190,6 +190,29 @@ MyGroupSchema.statics.refuseReqGroup = async function(idapp, username, groupname
|
||||
|
||||
};
|
||||
|
||||
// Aggiungi agli Admin del Gruppo
|
||||
MyGroupSchema.statics.addToAdminOfMyGroup = async function(idapp, username, groupnameDest) {
|
||||
|
||||
return MyGroup.updateOne({idapp, groupname: groupnameDest},
|
||||
{
|
||||
$push:
|
||||
{
|
||||
admins: {
|
||||
username,
|
||||
date: new Date(),
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
// Rimuovi dagli Admin del Gruppo
|
||||
MyGroupSchema.statics.removeAdminOfMyGroup = async function(idapp, username, groupnameDest) {
|
||||
|
||||
return MyGroup.updateOne({idapp, groupname: groupnameDest},
|
||||
{$pull: {admins: {username: {$in: [username]}}}});
|
||||
};
|
||||
|
||||
MyGroupSchema.statics.getWhatToShow = function(idapp, username) {
|
||||
// FOR ME, PERMIT ALL
|
||||
return {
|
||||
@@ -209,6 +232,8 @@ MyGroupSchema.statics.getWhatToShow = function(idapp, username) {
|
||||
blocked: 1,
|
||||
req_users: 1,
|
||||
refused_users: 1,
|
||||
createdBy: 1,
|
||||
date_created: 1,
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user