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