Ora cambiando Settore, la Categoria viene sbiancata su "Nessuno" (anche se ancora rimane visivamente selezionato)
i campi obbligatori non funziona il controllo? (Erano i campi di tipo Array) Aggiunta Categoria Ecovillaggi / Comunità + AutoProduzione Aggiunte consulenza, affrancamento, supporto.. su temi di LAVORO Quando inserisci un nuovo annuncio, prendi di default tutti i filtri visualizzati Aggiungere bottone "Condividi Pagina" sui gruppi
This commit is contained in:
@@ -22,7 +22,7 @@ module.exports = {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
_id: 6,
|
_id: 6,
|
||||||
descr: 'Benessere e Salute',
|
descr: 'Benessere',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
_id: 7,
|
_id: 7,
|
||||||
@@ -58,7 +58,7 @@ module.exports = {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
_id: 14,
|
_id: 14,
|
||||||
descr: 'Ecovillaggi',
|
descr: 'Ecovillaggi / Comunità',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
_id: 15,
|
_id: 15,
|
||||||
@@ -68,5 +68,13 @@ module.exports = {
|
|||||||
_id: 16,
|
_id: 16,
|
||||||
descr: 'Altro',
|
descr: 'Altro',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
_id: 17,
|
||||||
|
descr: 'AutoProduzione',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
_id: 18,
|
||||||
|
descr: 'Salute',
|
||||||
|
},
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -107,5 +107,8 @@ module.exports = {
|
|||||||
{_id: 105, idSector: [12], descr: 'OSS'},
|
{_id: 105, idSector: [12], descr: 'OSS'},
|
||||||
{_id: 106, idSector: [10], descr: 'Badante'},
|
{_id: 106, idSector: [10], descr: 'Badante'},
|
||||||
{_id: 107, idSector: [6], descr: 'Massaggi'},
|
{_id: 107, idSector: [6], descr: 'Massaggi'},
|
||||||
|
{_id: 108, idSector: [10], descr: 'Affrancamento'},
|
||||||
|
{_id: 109, idSector: [10], descr: 'Supporto'},
|
||||||
|
{_id: 110, idSector: [10], descr: 'Consulenza'},
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -220,8 +220,9 @@ router.post('/testServer', authenticate_noerror, (req, res) => {
|
|||||||
let ris = {test};
|
let ris = {test};
|
||||||
|
|
||||||
if (req.user) {
|
if (req.user) {
|
||||||
tools.sendNotificationToUser(req.user._id, 'Test Server', 'Test Server OK',
|
tools.sendNotificationToUser(req.user._id, 'Test Server',
|
||||||
'/', '', 'server', [])
|
'Test Server OK',
|
||||||
|
'/', '', 'server', []);
|
||||||
}
|
}
|
||||||
|
|
||||||
return res.send(ris);
|
return res.send(ris);
|
||||||
@@ -406,7 +407,7 @@ router.post('/setsubrec', authenticate, (req, res) => {
|
|||||||
|
|
||||||
router.post('/gettable', authenticate, (req, res) => {
|
router.post('/gettable', authenticate, (req, res) => {
|
||||||
const params = req.body;
|
const params = req.body;
|
||||||
let idapp = req.user.idapp
|
let idapp = req.user.idapp;
|
||||||
const mytable = globalTables.getTableByTableName(params.table);
|
const mytable = globalTables.getTableByTableName(params.table);
|
||||||
// console.log('mytable', mytable);
|
// console.log('mytable', mytable);
|
||||||
if (!mytable) {
|
if (!mytable) {
|
||||||
@@ -424,7 +425,8 @@ router.post('/gettable', authenticate, (req, res) => {
|
|||||||
res.status(400).send(e);
|
res.status(400).send(e);
|
||||||
});
|
});
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error(`ERROR gettable ${params.table}: `, e.message, 'params', params);
|
console.error(`ERROR gettable ${params.table}: `, e.message, 'params',
|
||||||
|
params);
|
||||||
res.status(500).send(e);
|
res.status(500).send(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -432,7 +434,7 @@ router.post('/gettable', authenticate, (req, res) => {
|
|||||||
|
|
||||||
router.post('/pickup', authenticate, (req, res) => {
|
router.post('/pickup', authenticate, (req, res) => {
|
||||||
const params = req.body;
|
const params = req.body;
|
||||||
let idapp = req.user.idapp
|
let idapp = req.user.idapp;
|
||||||
let mytable = globalTables.getTableByTableName(params.table);
|
let mytable = globalTables.getTableByTableName(params.table);
|
||||||
// console.log('mytable', mytable);
|
// console.log('mytable', mytable);
|
||||||
if (!mytable) {
|
if (!mytable) {
|
||||||
@@ -496,6 +498,7 @@ router.patch('/chval', authenticate, async (req, res) => {
|
|||||||
const idapp = req.user.idapp;
|
const idapp = req.user.idapp;
|
||||||
const mydata = req.body.data;
|
const mydata = req.body.data;
|
||||||
|
|
||||||
|
try {
|
||||||
const mytable = globalTables.getTableByTableName(mydata.table);
|
const mytable = globalTables.getTableByTableName(mydata.table);
|
||||||
const fieldsvalue = mydata.fieldsvalue;
|
const fieldsvalue = mydata.fieldsvalue;
|
||||||
const unset = mydata.unset;
|
const unset = mydata.unset;
|
||||||
@@ -577,8 +580,8 @@ router.patch('/chval', authenticate, async (req, res) => {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
await mytable.findByIdAndUpdate(id, {$set: fieldsvalue}).
|
||||||
await mytable.findByIdAndUpdate(id, {$set: fieldsvalue}).then(async (rec) => {
|
then(async (rec) => {
|
||||||
// tools.mylogshow(' REC TO MODIFY: ', rec);
|
// tools.mylogshow(' REC TO MODIFY: ', rec);
|
||||||
if (!rec) {
|
if (!rec) {
|
||||||
return res.status(404).send();
|
return res.status(404).send();
|
||||||
@@ -590,13 +593,16 @@ router.patch('/chval', authenticate, async (req, res) => {
|
|||||||
await telegrambot.sendMsgTelegram(idapp, mydata.notifBot.un,
|
await telegrambot.sendMsgTelegram(idapp, mydata.notifBot.un,
|
||||||
mydata.notifBot.txt);
|
mydata.notifBot.txt);
|
||||||
if (!!addmsg)
|
if (!!addmsg)
|
||||||
await telegrambot.sendMsgTelegram(idapp, mydata.notifBot.un, addmsg);
|
await telegrambot.sendMsgTelegram(idapp, mydata.notifBot.un,
|
||||||
let addtext = '[Msg Inviato a ' + mydata.notifBot.un + ']:' + '\n' +
|
addmsg);
|
||||||
|
let addtext = '[Msg Inviato a ' + mydata.notifBot.un + ']:' +
|
||||||
|
'\n' +
|
||||||
mydata.notifBot.txt;
|
mydata.notifBot.txt;
|
||||||
telegrambot.sendMsgTelegramToTheManagers(idapp, addtext, true);
|
telegrambot.sendMsgTelegramToTheManagers(idapp, addtext, true);
|
||||||
|
|
||||||
if (!!flotta)
|
if (!!flotta)
|
||||||
tools.writeFlottaLog(idapp, addtext, flotta.riga, flotta.col_prima);
|
tools.writeFlottaLog(idapp, addtext, flotta.riga,
|
||||||
|
flotta.col_prima);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mydata.table === 'users') {
|
if (mydata.table === 'users') {
|
||||||
@@ -620,7 +626,10 @@ router.patch('/chval', authenticate, async (req, res) => {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
res.send(
|
res.send(
|
||||||
{code: server_constants.RIS_CODE_ERR, msg: 'Non aggiornato'});
|
{
|
||||||
|
code: server_constants.RIS_CODE_ERR,
|
||||||
|
msg: 'Non aggiornato',
|
||||||
|
});
|
||||||
res.status(400).send();
|
res.status(400).send();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -642,16 +651,19 @@ router.patch('/chval', authenticate, async (req, res) => {
|
|||||||
let msg = '';
|
let msg = '';
|
||||||
if (mydata.table === 'users') {
|
if (mydata.table === 'users') {
|
||||||
if ('aportador_solidario' in fieldsvalue) {
|
if ('aportador_solidario' in fieldsvalue) {
|
||||||
const nomecognomenuovo = await User.getNameSurnameByUsername(idapp,
|
const nomecognomenuovo = await User.getNameSurnameByUsername(
|
||||||
|
idapp,
|
||||||
fieldsvalue.aportador_solidario);
|
fieldsvalue.aportador_solidario);
|
||||||
const nomecognomeas = await User.getNameSurnameByUsername(idapp,
|
const nomecognomeas = await User.getNameSurnameByUsername(
|
||||||
|
idapp,
|
||||||
rec.aportador_solidario);
|
rec.aportador_solidario);
|
||||||
msg = `Variato l'invitante di ` +
|
msg = `Variato l'invitante di ` +
|
||||||
tools.getNomeCognomeEUserNameByUser(rec) +
|
tools.getNomeCognomeEUserNameByUser(rec) +
|
||||||
'\nmodificato da ' +
|
'\nmodificato da ' +
|
||||||
tools.getNomeCognomeEUserNameByUser(req.user) +
|
tools.getNomeCognomeEUserNameByUser(req.user) +
|
||||||
' \n' +
|
' \n' +
|
||||||
'Prima: ' + nomecognomeas + ' (' + rec.aportador_solidario +
|
'Prima: ' + nomecognomeas + ' (' +
|
||||||
|
rec.aportador_solidario +
|
||||||
')\n' +
|
')\n' +
|
||||||
'Dopo: ' + nomecognomenuovo + ' (' +
|
'Dopo: ' + nomecognomenuovo + ' (' +
|
||||||
fieldsvalue.aportador_solidario + ') ]';
|
fieldsvalue.aportador_solidario + ') ]';
|
||||||
@@ -674,10 +686,15 @@ router.patch('/chval', authenticate, async (req, res) => {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}).catch((e) => {
|
}).
|
||||||
|
catch((e) => {
|
||||||
tools.mylogserr('Error patch USER: ', e.message);
|
tools.mylogserr('Error patch USER: ', e.message);
|
||||||
res.status(400).send();
|
res.status(400).send();
|
||||||
});
|
});
|
||||||
|
} catch (e) {
|
||||||
|
tools.mylogserr('Error chval: ', e.message);
|
||||||
|
res.status(400).send();
|
||||||
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -939,6 +939,7 @@ async function eseguiDbOp(idapp, mydata, locale) {
|
|||||||
const {AdType} = require('../models/adtype');
|
const {AdType} = require('../models/adtype');
|
||||||
const {AdTypeGood} = require('../models/adtypegood');
|
const {AdTypeGood} = require('../models/adtypegood');
|
||||||
const {StatusSkill} = require('../models/statusSkill');
|
const {StatusSkill} = require('../models/statusSkill');
|
||||||
|
const {CatGrp} = require('../models/catgrp');
|
||||||
|
|
||||||
await Sector.deleteMany({});
|
await Sector.deleteMany({});
|
||||||
await SectorGood.deleteMany({});
|
await SectorGood.deleteMany({});
|
||||||
@@ -949,6 +950,7 @@ async function eseguiDbOp(idapp, mydata, locale) {
|
|||||||
await AdType.deleteMany({});
|
await AdType.deleteMany({});
|
||||||
await AdTypeGood.deleteMany({});
|
await AdTypeGood.deleteMany({});
|
||||||
await StatusSkill.deleteMany({});
|
await StatusSkill.deleteMany({});
|
||||||
|
await CatGrp.deleteMany({});
|
||||||
|
|
||||||
ris = await populate.popolaTabelleNuove();
|
ris = await populate.popolaTabelleNuove();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user