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:
@@ -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) {
|
||||
|
||||
@@ -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