Add to the Circuit
Remove to the Circuit Revoke request Users Admins
This commit is contained in:
@@ -45,23 +45,24 @@ router.post('/load', authenticate, async (req, res) => {
|
||||
const whatshow = Circuit.getWhatToShow(idapp, req.user.username);
|
||||
let data = await Circuit.findOne({idapp, path}, whatshow).lean();
|
||||
|
||||
let cities = [];
|
||||
const whatshowUsers = await User.getWhatToShow_IfFriends(idapp, req.user.username);
|
||||
|
||||
let users_in_circuit = [];
|
||||
if (data && data.circuitId) {
|
||||
|
||||
if (data) {
|
||||
users_in_circuit = await User.find(
|
||||
{
|
||||
idapp,
|
||||
circuitId: data.circuitId,
|
||||
'profile.mycircuits': {
|
||||
$elemMatch: {circuitname: {$eq: data.name}},
|
||||
},
|
||||
},
|
||||
whatshowUsers,
|
||||
).lean();
|
||||
|
||||
}
|
||||
|
||||
data = await getCircuitRecAdminsInfo(idapp, data);
|
||||
|
||||
const whatshowUsers = await User.getWhatToShow_IfFriends(idapp, req.user.username);
|
||||
|
||||
res.send({circuit: data, users_in_circuit});
|
||||
|
||||
} catch (e) {
|
||||
|
||||
Reference in New Issue
Block a user