- comune residenza anche sulla email
This commit is contained in:
@@ -317,6 +317,10 @@ html(lang="it")
|
||||
.member-detail
|
||||
strong Email:
|
||||
| #{emailInvitato}
|
||||
if userprofile && userprofile.profile.resid_str_comune && userprofile.profile.resid_province
|
||||
.member-detail
|
||||
strong Comune Residenza:
|
||||
| #{userprofile.profile.resid_str_comune} (#{userprofile.profile.resid_province})
|
||||
|
||||
//- Domanda di conferma
|
||||
.question-box
|
||||
|
||||
@@ -158,6 +158,12 @@ html(lang="it")
|
||||
.info-value
|
||||
| #{user.profile.intcode_cell || ''} #{user.profile.cell || ''}
|
||||
|
||||
if user && user.profile && (user.profile.resid_str_comune && user.profile.resid_province)
|
||||
.info-row
|
||||
.info-label Comune di Residenza:
|
||||
.info-value
|
||||
| #{user.profile.resid_str_comune || ''} (#{user.profile.resid_province || ''})
|
||||
|
||||
if user && user.profile && user.profile.nationality
|
||||
.info-row
|
||||
.info-label Nazionalità:
|
||||
|
||||
@@ -317,6 +317,10 @@ html(lang="it")
|
||||
.member-detail
|
||||
strong Email:
|
||||
| #{emailInvitato}
|
||||
if userprofile && userprofile.profile.resid_str_comune && userprofile.profile.resid_province
|
||||
.member-detail
|
||||
strong Comune Residenza:
|
||||
| #{userprofile.profile.resid_str_comune} (#{userprofile.profile.resid_province})
|
||||
|
||||
//- Domanda di conferma
|
||||
.question-box
|
||||
|
||||
@@ -932,13 +932,12 @@ UserSchema.statics.findByToken = async function (
|
||||
decoded,
|
||||
token,
|
||||
typeaccess,
|
||||
browser_random,
|
||||
browser_random,
|
||||
withuser,
|
||||
withlean,
|
||||
project
|
||||
);
|
||||
|
||||
|
||||
// Verifica scadenza token per idapp specifici
|
||||
if (user) {
|
||||
const checkExpiry = tools.getEnableTokenExpiredByIdApp(user.idapp);
|
||||
@@ -4443,6 +4442,20 @@ UserSchema.statics.getNameSurnameEUsernameByUsername = async function (idapp, us
|
||||
console.error('getNameSurnameByUsername', e);
|
||||
});
|
||||
};
|
||||
UserSchema.statics.getProfileByUsername = async function (idapp, username, reale = false) {
|
||||
const User = this;
|
||||
|
||||
return await User.findOne(
|
||||
{
|
||||
idapp,
|
||||
username,
|
||||
$or: [{ deleted: { $exists: false } }, { deleted: { $exists: true, $eq: false } }],
|
||||
},
|
||||
{ profile: 1 }
|
||||
).catch((e) => {
|
||||
console.error('getNameSurnameByUsername', e);
|
||||
});
|
||||
};
|
||||
|
||||
UserSchema.statics.getIdByUsername = async function (idapp, username) {
|
||||
const User = this;
|
||||
@@ -6849,11 +6862,7 @@ UserSchema.statics.updateProvinceUserByComune = async function (idapp, userId, i
|
||||
'profile.resid_province': recCity ? recCity.prov : '',
|
||||
};
|
||||
|
||||
await User.findOneAndUpdate(
|
||||
{ _id: userId },
|
||||
{ $set: updateData },
|
||||
{ new: true }
|
||||
);
|
||||
await User.findOneAndUpdate({ _id: userId }, { $set: updateData }, { new: true });
|
||||
|
||||
// Ritorna i dati aggiornati nel formato che ti serve
|
||||
return {
|
||||
@@ -6865,12 +6874,12 @@ UserSchema.statics.updateProvinceUserByComune = async function (idapp, userId, i
|
||||
};
|
||||
} catch (e) {
|
||||
console.error('Errore updateProvinceUserByComune', e.message);
|
||||
return {
|
||||
return {
|
||||
_id: userId,
|
||||
profile: {
|
||||
resid_str_comune: '',
|
||||
resid_province: ''
|
||||
}
|
||||
resid_str_comune: '',
|
||||
resid_province: '',
|
||||
},
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
@@ -543,6 +543,7 @@ module.exports = {
|
||||
usernameInvitante: user.aportador_solidario,
|
||||
nomeInvitante: nomecognomeInvitante.trim(),
|
||||
nomeInvitato: await User.getNameSurnameEUsernameByUsername(idapp, user.username),
|
||||
userprofile: await User.getProfileByUsername(idapp, user.username),
|
||||
usernameInvitato: user.username,
|
||||
emailInvitato: user.email,
|
||||
user,
|
||||
|
||||
Reference in New Issue
Block a user