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:
Paolo Arena
2022-03-30 22:51:03 +02:00
parent d91aeadb5c
commit 14d45646d2
6 changed files with 40 additions and 18 deletions

View File

@@ -223,6 +223,7 @@ router.post('/settable', authenticate, async (req, res) => {
const fieldsvalue = {'ALL': 1};
mydata.idapp = req.user.idapp;
const idapp = mydata.idapp;
let consentito = false;
@@ -1385,6 +1386,11 @@ function uploadFile(req, res, version) {
oldpath = file.path;
file.path = newname;
if (!tools.sulServer()) {
res.end();
return;
}
// Move in the folder application !
tools.move(oldpath, newname, (err) => {
if (err) {

View File

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