0.3.14:
Se errore di connessione al Server: compare l'username telegram ! Se Cookie disattivati: non riesci a loggare. sui Gruppi: non si vede il Comune ! Sei stato accettato da paoloar77 a far parte del Gruppo Terraw. MSG SBAGLIATO l'immagine dell'amministratore del gruppo non compariva
This commit is contained in:
@@ -16,13 +16,25 @@ const _ = require('lodash');
|
||||
|
||||
const {ObjectID} = require('mongodb');
|
||||
|
||||
async function getGroupRecAdminsInfo(idapp, data) {
|
||||
|
||||
for (const admin of data.admins) {
|
||||
const myuser = await User.findOne({idapp, username: admin.username}).lean();
|
||||
admin.profile = { img: myuser.profile.img };
|
||||
}
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
router.post('/load', authenticate, async (req, res) => {
|
||||
const idapp = req.body.idapp;
|
||||
const groupname = req.body.groupname;
|
||||
|
||||
try {
|
||||
const whatshow = MyGroup.getWhatToShow(idapp, req.user.username);
|
||||
const data = await MyGroup.findOne({idapp, groupname}, whatshow).lean();
|
||||
let data = await MyGroup.findOne({idapp, groupname}, whatshow).lean();
|
||||
|
||||
data = await getGroupRecAdminsInfo(idapp, data);
|
||||
|
||||
const whatshowUsers = await User.getWhatToShow_IfFriends(idapp, req.user.username);
|
||||
|
||||
@@ -31,9 +43,9 @@ router.post('/load', authenticate, async (req, res) => {
|
||||
idapp,
|
||||
'profile.mygroups': {
|
||||
$elemMatch: {groupname: {$eq: groupname}},
|
||||
}
|
||||
},
|
||||
},
|
||||
whatshowUsers
|
||||
whatshowUsers,
|
||||
);
|
||||
|
||||
res.send({mygroup: data, users_in_group});
|
||||
|
||||
Reference in New Issue
Block a user