Modifiche prima di Luglio...

This commit is contained in:
Surya Paolo
2023-08-27 23:55:31 +02:00
parent ba81a33c88
commit ad6b4c2bfa
21 changed files with 1747 additions and 2251 deletions

View File

@@ -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;