- fix: La partecipazione agli eventi, non viene salvata correttamente e non visualizzava.

This commit is contained in:
Surya Paolo
2024-09-30 14:50:19 +02:00
parent 0973fc8757
commit 0a9e012de0
6 changed files with 58 additions and 14 deletions

View File

@@ -1300,14 +1300,22 @@ sendNotifSchema.statics.RemoveOldNotif = async function (idapp, numgg) {
{ {
idapp, idapp,
date_created: { $lt: limitDate }, date_created: { $lt: limitDate },
typedir: { $ne: shared_consts.TypeNotifs.TYPEDIR_CIRCUITS }, // typedir: { $ne: shared_consts.TypeNotifs.TYPEDIR_CIRCUITS },
$or: [
{ typeid: { $ne: shared_consts.TypeNotifs.ID_CIRCUIT_SENDCOINSREQ } },
{ status: { $ne: 0 } }
]
} }
); );
}; };
sendNotifSchema.statics.RemoveOldNotif90 = async function (idapp) { sendNotifSchema.statics.RemoveOldNotif90 = async function (idapp) {
return this.RemoveOldNotif90(idapp, 90); return this.RemoveOldNotif(idapp, 90);
}
sendNotifSchema.statics.RemoveOldNotif30 = async function (idapp) {
return this.RemoveOldNotif(idapp, 30);
} }
sendNotifSchema.statics.updatePendingTransactions = async function (recnotif) { sendNotifSchema.statics.updatePendingTransactions = async function (recnotif) {

View File

@@ -45,7 +45,7 @@ router.post('/', authenticate, (req, res) => {
// console.log('trovato', trovato); // console.log('trovato', trovato);
if (trovato) { if (trovato) {
return Booking.findOneAndUpdate({ id_bookedevent: id }, { $set: fieldtochange }, { return Booking.findOneAndUpdate({ id_bookedevent: id }, { $set: fieldtochange }, {
new: false, new: true,
upsert: true upsert: true
}).then((recbooking) => { }).then((recbooking) => {
// tools.mylog('booking:', booking); // tools.mylog('booking:', booking);
@@ -79,7 +79,7 @@ router.delete('/:id/:notify/:idapp', authenticate, (req, res) => {
const notify = req.params.notify; const notify = req.params.notify;
const idapp = req.params.idapp; const idapp = req.params.idapp;
Booking.deleteOne({_id: id}).then((recbooking) => { Booking.findOneAndDelete({_id: id}).then((recbooking) => {
if (!recbooking) { if (!recbooking) {
return res.status(404).send(); return res.status(404).send();
} }

View File

@@ -1409,7 +1409,13 @@ router.get('/loadsite/:userId/:idapp/:vers', authenticate_noerror,
function load(req, res, version) { function load(req, res, version) {
const userId = req.params.userId; let userId = '0';
try {
userId = req.user ? req.user._id.toString() : req.params.userId;
} catch (e) {
console.error('Err userId LOAD', e);
userId = '0';
}
const idapp = req.params.idapp; const idapp = req.params.idapp;
let status = 200 let status = 200

View File

@@ -1432,6 +1432,8 @@ async function eseguiDbOp(idapp, mydata, locale, req, res) {
await SendNotif.RemovePendentTransactions(true); await SendNotif.RemovePendentTransactions(true);
} else if (mydata.dbop === 'RemoveOldNotif90') { } else if (mydata.dbop === 'RemoveOldNotif90') {
await SendNotif.RemoveOldNotif90(idapp); await SendNotif.RemoveOldNotif90(idapp);
} else if (mydata.dbop === 'RemoveOldNotif30') {
await SendNotif.RemoveOldNotif30(idapp);
} else if (mydata.dbop === 'UpdateCoordProv') { } else if (mydata.dbop === 'UpdateCoordProv') {
await Province.setCoordinatesOnDB(); await Province.setCoordinatesOnDB();
} else if (mydata.dbop === 'insertGeojsonToMongoDB') { } else if (mydata.dbop === 'insertGeojsonToMongoDB') {

View File

@@ -136,6 +136,7 @@ const textlang = {
'ACCETTATO_NOTIFICA_ADMINS': '✅ l\'utente %s è stato accettato a far parte del Gruppo %s (da parte di %s)', 'ACCETTATO_NOTIFICA_ADMINS': '✅ l\'utente %s è stato accettato a far parte del Gruppo %s (da parte di %s)',
'GROUP_REQUEST': 'Richiesta di entrare nel Gruppo %s da parte di %s', 'GROUP_REQUEST': 'Richiesta di entrare nel Gruppo %s da parte di %s',
"CLICCA_QUI": "CLICCA QUI", "CLICCA_QUI": "CLICCA QUI",
"TELEFONO": "Tel",
}, },
si: {}, si: {},
es: { es: {
@@ -1724,7 +1725,12 @@ module.exports = {
removeSpecialCharForEmail(myhtml) { removeSpecialCharForEmail(myhtml) {
let msg = myhtml; let msg = myhtml;
try {
if (msg)
msg = msg.replace(/"/g, '\''); msg = msg.replace(/"/g, '\'');
} catch (e) {
return msg;
}
return msg; return msg;
}, },
@@ -2380,6 +2386,13 @@ module.exports = {
query = [...query, ...queryadd]; query = [...query, ...queryadd];
} }
} }
const numtabbacheca = this.getNumTabByTable(shared_consts.TABLES_MYBACHECAS);
if (numtab === numtabbacheca) {
const queryadd = this.getQueryMyBacheca(idapp);
query = [...query, ...queryadd];
}
*/ */
proj = { proj = {
@@ -2422,11 +2435,13 @@ module.exports = {
numpeople: 1, numpeople: 1,
numpeopleLunch: 1, numpeopleLunch: 1,
numpeopleDinner: 1, numpeopleDinner: 1,
numpeopleDinnerShared: 1,
infoevent: 1, infoevent: 1,
msgbooking: 1, msgbooking: 1,
booked: 1, booked: 1,
datebooked: 1, datebooked: 1,
userId: 1, userId: 1,
idapp: 1,
} }
}, },
], ],
@@ -3114,6 +3129,11 @@ module.exports = {
} }
} }
if (params.table === shared_consts.TABLES_MYBACHECAS) {
const myq = this.getQueryMyBacheca(idapp);
query.push(myq[0]);
}
if (params.filtersearch3or) { if (params.filtersearch3or) {
if (params.filtersearch3or.length > 0) { if (params.filtersearch3or.length > 0) {
query.push({ $match: { $or: params.filtersearch3or } }); query.push({ $match: { $or: params.filtersearch3or } });
@@ -5120,6 +5140,8 @@ module.exports = {
let tiposcambio = '' let tiposcambio = ''
let iconascambio = '🟢'; let iconascambio = '🟢';
let lang = 'it';
let datastr = ''; let datastr = '';
let dovestr = ''; let dovestr = '';
let organizedby = ''; let organizedby = '';
@@ -5159,11 +5181,14 @@ module.exports = {
} }
let contatto = userorig; let contatto = userorig;
let contatto_telegram = '';
try { try {
let username_telegram = myrec.profile.username_telegram; let username_telegram = myrec.profile.username_telegram;
if (username_telegram) if (username_telegram) {
contatto = `@${username_telegram}`; contatto_telegram = `@${username_telegram}`;
contatto = contatto_telegram;
}
} catch (e) { } catch (e) {
} }
@@ -5189,11 +5214,11 @@ module.exports = {
organizedBy = myrec.organisedBy; organizedBy = myrec.organisedBy;
contatto = ''; contatto = '';
} }
if (myrec.contact_phone) { if ((myrec.contact_telegram.toLowerCase() !== contatto_telegram.toLowerCase()) || !contatto) {
contatto += '/n' + myrec.contact_phone; contatto += '\n' + myrec.contact_telegram;
} }
if (myrec.contact_telegram) { if (myrec.contact_phone) {
contatto += '/n' + myrec.contact_telegram; contatto += ' - ' + this.get__('TELEFONO', lang) + ': ' + myrec.contact_phone;
} }
} }
@@ -5642,7 +5667,10 @@ module.exports = {
} }
} }
if (!this.sulServer()) {
// Finta Immagine
img = 'https://riso.app/upload/profile/SoniaVioletFlame/myskills/1000133092.jpg'; img = 'https://riso.app/upload/profile/SoniaVioletFlame/myskills/1000133092.jpg';
}
return img; return img;
} catch (e) { } catch (e) {

View File

@@ -1 +1 @@
1.0.61 1.1.0