- Pagina MySkills personale
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user