Group Page : visibility, some info, members views.
This commit is contained in:
@@ -44,6 +44,14 @@ router.post('/load', authenticate, async (req, res) => {
|
||||
const whatshow = MyGroup.getWhatToShow(idapp, req.user.username);
|
||||
let data = await MyGroup.findOne({idapp, groupname}, whatshow).lean();
|
||||
|
||||
let cities = [];
|
||||
if (data) {
|
||||
cities = await MyGroup.extractCitiesName(idapp, data._id);
|
||||
if (cities && cities.length > 0) {
|
||||
cities = cities[0].mycities;
|
||||
}
|
||||
}
|
||||
|
||||
data = await getGroupRecAdminsInfo(idapp, data);
|
||||
|
||||
const whatshowUsers = await User.getWhatToShow_IfFriends(idapp, req.user.username);
|
||||
@@ -56,9 +64,9 @@ router.post('/load', authenticate, async (req, res) => {
|
||||
},
|
||||
},
|
||||
whatshowUsers,
|
||||
);
|
||||
).lean();
|
||||
|
||||
res.send({mygroup: data, users_in_group});
|
||||
res.send({mygroup: data, users_in_group, cities});
|
||||
|
||||
} catch (e) {
|
||||
console.error('Error in MyGroups', e);
|
||||
|
||||
Reference in New Issue
Block a user