- Pagina MySkills personale

This commit is contained in:
paoloar77
2022-01-26 01:31:22 +01:00
parent 6b8e4af737
commit 842a041fe5
9 changed files with 473 additions and 21 deletions

View File

@@ -225,6 +225,12 @@ const UserSchema = new mongoose.Schema({
username_telegram: {
type: String,
},
firstname_telegram: {
type: String,
},
lastname_telegram: {
type: String,
},
website: {
type: String,
},
@@ -1660,6 +1666,24 @@ UserSchema.statics.SetTelegramIdSuccess = async function(idapp, id, teleg_id) {
};
UserSchema.statics.setUsernameTelegram = async function(idapp, id, username_telegram, firstname_telegram, lastname_telegram) {
const User = this;
const fields_to_update = {
'profile.username_telegram': username_telegram,
'profile.firstname_telegram': firstname_telegram,
'profile.lastname_telegram': lastname_telegram,
};
return User.findOneAndUpdate({
idapp,
_id: id,
}, {$set: fields_to_update}, {new: false}).then((record) => {
return record;
});
};
UserSchema.statics.getLangByIndOrder = async function(idapp, ind_order) {
const User = this;