- Accepted and Refused Group Entering

- Report a User
This commit is contained in:
paoloar77
2022-08-04 17:30:57 +02:00
parent d902783336
commit 8a587dc715
16 changed files with 529 additions and 266 deletions

View File

@@ -18,9 +18,11 @@ 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 };
if (data && data.admins) {
for (const admin of data.admins) {
const myuser = await User.findOne({idapp, username: admin.username}, {'profile.img': 1}).lean();
admin.profile = {img: myuser.profile.img};
}
}
return data;