Aggiunto comune, + filtro regione e provincia

aggiunto Visibilità (da fare check)
This commit is contained in:
Paolo Arena
2022-09-18 20:17:24 +02:00
parent 9d072d4d0d
commit bcb276518f
12 changed files with 127 additions and 19 deletions

View File

@@ -2642,6 +2642,16 @@ UserSchema.statics.SetTelegramIdSuccess = async function(idapp, id, teleg_id) {
};
UserSchema.statics.getUsernameTelegram = async function(idapp, username) {
const User = this;
return await User.findOne({idapp, username}, {'profile.username_telegram': 1}).lean().then((ris) => {
if (ris)
return ris.profile.username_telegram
else
return '';
});
};
UserSchema.statics.setUsernameTelegram = async function(
idapp, id, username_telegram, firstname_telegram, lastname_telegram) {
const User = this;