InfiniteScroll 3

fix user list
send telegram text
invited show in profile
This commit is contained in:
paoloar77
2022-08-18 05:26:50 +02:00
parent fa2b03f2c8
commit 5dfcd4f7fa
4 changed files with 39 additions and 0 deletions

View File

@@ -31,6 +31,9 @@ const CircuitSchema = new Schema({
longdescr: {
type: String,
},
regulation: {
type: String,
},
systemUserDescr: {
type: String,
},

View File

@@ -1372,9 +1372,12 @@ UserSchema.statics.getUserProfileByUsername = async function(
username_who_report: 1,
verified_email: 1,
verified_by_aportador: 1,
aportador_solidario: 1,
date_reg: 1,
'profile.username_telegram': 1,
'profile.img': 1,
"useraport.username": 1,
"useraport.profile.img": 1,
};
} else if (perm === tools.Perm.PERM_FRIEND) {
@@ -1411,6 +1414,8 @@ UserSchema.statics.getUserProfileByUsername = async function(
'profile.born_country': 1,
email: 1,
date_reg: 1,
"useraport.username": 1,
"useraport.profile.img": 1,
};
} else if (perm === tools.Perm.PERM_ALL) {
@@ -1450,6 +1455,8 @@ UserSchema.statics.getUserProfileByUsername = async function(
'comune': 1,
email: 1,
date_reg: 1,
"useraport.username": 1,
"useraport.profile.img": 1,
};
}
@@ -1468,6 +1475,31 @@ UserSchema.statics.getUserProfileByUsername = async function(
as: 'mycities',
},
},
{
"$lookup": {
"from": 'users',
let: {
"idapp": "$idapp",
"user_name": "$aportador_solidario"
},
pipeline: [
{ "$match": {
"$expr": {
$and: [
{ $eq: ['$username', '$$user_name'] },
{ $eq: ['$idapp','$$idapp'] }
]
}
}
}
],
as: 'useraport'
}
},
{
$unwind:'$useraport'
},
{
'$replaceRoot': {
'newRoot': {