Modifiche prima di Luglio...
This commit is contained in:
@@ -19,11 +19,17 @@ const { ObjectID } = require('mongodb');
|
||||
|
||||
async function getCircuitRecAdminsInfo(idapp, data) {
|
||||
|
||||
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 };
|
||||
try {
|
||||
if (data && data.admins) {
|
||||
for (const admin of data.admins) {
|
||||
const myuser = await User.findOne({ idapp, username: admin.username }, { 'profile.img': 1 }).lean();
|
||||
if (myuser && myuser.profile)
|
||||
admin.profile = { img: myuser.profile.img };
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
return data;
|
||||
}
|
||||
|
||||
return data;
|
||||
|
||||
Reference in New Issue
Block a user