- Nuovo Sistema di Flotte per Tutor.

X - Mettere anche la email del sognatore, per chi è abituato ad inviarla in quel modo...
X - Controllare che sul sito compaiano le informazioni del Sognatore...
This commit is contained in:
Paolo Arena
2020-06-08 13:31:05 +02:00
parent 140e181fcc
commit c939be279e
21 changed files with 2037 additions and 254 deletions

View File

@@ -13,7 +13,7 @@ const tools = require('../../tools/general');
const telegrambot = require('../../telegram/telegrambot');
module.exports = {
doOtherThingsAfterDeleted: async function (tablename, rec, notifBot) {
doOtherThingsAfterDeleted: async function (tablename, rec, notifBot, req) {
try {
let ris = null;
if (tablename === 'users') {
@@ -42,12 +42,13 @@ module.exports = {
ris = await Graduatoria.deleteOne({ idListaIngresso: ObjectID(rec._id) });
if (!!ris) {
let msg = 'Eliminato Imbarco di ' + rec.name + ' ' + rec.surname + ' [Index = ' + rec.index + ']';
let msg = 'Eliminato Imbarco di ' + rec.name + ' ' + rec.surname + ' (ind_order=' + rec.ind_order + ', num_tess=' + rec.num_tess + ') [Num = ' + rec.index + `] (da ${req.user.name} ${req.user.surname} )` ;
await telegrambot.sendMsgTelegramToTheManagers(rec.idapp, msg);
tools.writeSostituzioniLog(msg);
}
// Elimina anche la Nave se è temporanea!
const arrnave = await Nave.find({ idapp: rec.idapp, ind_order: rec.ind_order });
const arrnave = await Nave.find({ idapp: rec.idapp, ind_order: rec.ind_order, num_tess: rec.num_tess });
for (const mynave of arrnave) {
if (!!mynave) {
if (!await Nave.isDefinitiva(rec.idapp, mynave)) {