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,
|
||||
descr: 'Benessere e Salute',
|
||||
descr: 'Benessere',
|
||||
},
|
||||
{
|
||||
_id: 7,
|
||||
@@ -58,7 +58,7 @@ module.exports = {
|
||||
},
|
||||
{
|
||||
_id: 14,
|
||||
descr: 'Ecovillaggi',
|
||||
descr: 'Ecovillaggi / Comunità',
|
||||
},
|
||||
{
|
||||
_id: 15,
|
||||
@@ -68,5 +68,13 @@ module.exports = {
|
||||
_id: 16,
|
||||
descr: 'Altro',
|
||||
},
|
||||
{
|
||||
_id: 17,
|
||||
descr: 'AutoProduzione',
|
||||
},
|
||||
{
|
||||
_id: 18,
|
||||
descr: 'Salute',
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
@@ -107,5 +107,8 @@ module.exports = {
|
||||
{_id: 105, idSector: [12], descr: 'OSS'},
|
||||
{_id: 106, idSector: [10], descr: 'Badante'},
|
||||
{_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};
|
||||
|
||||
if (req.user) {
|
||||
tools.sendNotificationToUser(req.user._id, 'Test Server', 'Test Server OK',
|
||||
'/', '', 'server', [])
|
||||
tools.sendNotificationToUser(req.user._id, 'Test Server',
|
||||
'Test Server OK',
|
||||
'/', '', 'server', []);
|
||||
}
|
||||
|
||||
return res.send(ris);
|
||||
@@ -406,7 +407,7 @@ router.post('/setsubrec', authenticate, (req, res) => {
|
||||
|
||||
router.post('/gettable', authenticate, (req, res) => {
|
||||
const params = req.body;
|
||||
let idapp = req.user.idapp
|
||||
let idapp = req.user.idapp;
|
||||
const mytable = globalTables.getTableByTableName(params.table);
|
||||
// console.log('mytable', mytable);
|
||||
if (!mytable) {
|
||||
@@ -423,8 +424,9 @@ router.post('/gettable', authenticate, (req, res) => {
|
||||
console.error('gettable: ' + e.message);
|
||||
res.status(400).send(e);
|
||||
});
|
||||
}catch (e) {
|
||||
console.error(`ERROR gettable ${params.table}: `, e.message, 'params', params);
|
||||
} catch (e) {
|
||||
console.error(`ERROR gettable ${params.table}: `, e.message, 'params',
|
||||
params);
|
||||
res.status(500).send(e);
|
||||
}
|
||||
|
||||
@@ -432,7 +434,7 @@ router.post('/gettable', authenticate, (req, res) => {
|
||||
|
||||
router.post('/pickup', authenticate, (req, res) => {
|
||||
const params = req.body;
|
||||
let idapp = req.user.idapp
|
||||
let idapp = req.user.idapp;
|
||||
let mytable = globalTables.getTableByTableName(params.table);
|
||||
// console.log('mytable', mytable);
|
||||
if (!mytable) {
|
||||
@@ -496,6 +498,7 @@ router.patch('/chval', authenticate, async (req, res) => {
|
||||
const idapp = req.user.idapp;
|
||||
const mydata = req.body.data;
|
||||
|
||||
try {
|
||||
const mytable = globalTables.getTableByTableName(mydata.table);
|
||||
const fieldsvalue = mydata.fieldsvalue;
|
||||
const unset = mydata.unset;
|
||||
@@ -577,8 +580,8 @@ router.patch('/chval', authenticate, async (req, res) => {
|
||||
|
||||
}
|
||||
|
||||
|
||||
await mytable.findByIdAndUpdate(id, {$set: fieldsvalue}).then(async (rec) => {
|
||||
await mytable.findByIdAndUpdate(id, {$set: fieldsvalue}).
|
||||
then(async (rec) => {
|
||||
// tools.mylogshow(' REC TO MODIFY: ', rec);
|
||||
if (!rec) {
|
||||
return res.status(404).send();
|
||||
@@ -590,13 +593,16 @@ router.patch('/chval', authenticate, async (req, res) => {
|
||||
await telegrambot.sendMsgTelegram(idapp, mydata.notifBot.un,
|
||||
mydata.notifBot.txt);
|
||||
if (!!addmsg)
|
||||
await telegrambot.sendMsgTelegram(idapp, mydata.notifBot.un, addmsg);
|
||||
let addtext = '[Msg Inviato a ' + mydata.notifBot.un + ']:' + '\n' +
|
||||
await telegrambot.sendMsgTelegram(idapp, mydata.notifBot.un,
|
||||
addmsg);
|
||||
let addtext = '[Msg Inviato a ' + mydata.notifBot.un + ']:' +
|
||||
'\n' +
|
||||
mydata.notifBot.txt;
|
||||
telegrambot.sendMsgTelegramToTheManagers(idapp, addtext, true);
|
||||
|
||||
if (!!flotta)
|
||||
tools.writeFlottaLog(idapp, addtext, flotta.riga, flotta.col_prima);
|
||||
tools.writeFlottaLog(idapp, addtext, flotta.riga,
|
||||
flotta.col_prima);
|
||||
}
|
||||
|
||||
if (mydata.table === 'users') {
|
||||
@@ -620,7 +626,10 @@ router.patch('/chval', authenticate, async (req, res) => {
|
||||
}
|
||||
} else {
|
||||
res.send(
|
||||
{code: server_constants.RIS_CODE_ERR, msg: 'Non aggiornato'});
|
||||
{
|
||||
code: server_constants.RIS_CODE_ERR,
|
||||
msg: 'Non aggiornato',
|
||||
});
|
||||
res.status(400).send();
|
||||
return false;
|
||||
}
|
||||
@@ -642,16 +651,19 @@ router.patch('/chval', authenticate, async (req, res) => {
|
||||
let msg = '';
|
||||
if (mydata.table === 'users') {
|
||||
if ('aportador_solidario' in fieldsvalue) {
|
||||
const nomecognomenuovo = await User.getNameSurnameByUsername(idapp,
|
||||
const nomecognomenuovo = await User.getNameSurnameByUsername(
|
||||
idapp,
|
||||
fieldsvalue.aportador_solidario);
|
||||
const nomecognomeas = await User.getNameSurnameByUsername(idapp,
|
||||
const nomecognomeas = await User.getNameSurnameByUsername(
|
||||
idapp,
|
||||
rec.aportador_solidario);
|
||||
msg = `Variato l'invitante di ` +
|
||||
tools.getNomeCognomeEUserNameByUser(rec) +
|
||||
'\nmodificato da ' +
|
||||
tools.getNomeCognomeEUserNameByUser(req.user) +
|
||||
' \n' +
|
||||
'Prima: ' + nomecognomeas + ' (' + rec.aportador_solidario +
|
||||
'Prima: ' + nomecognomeas + ' (' +
|
||||
rec.aportador_solidario +
|
||||
')\n' +
|
||||
'Dopo: ' + nomecognomenuovo + ' (' +
|
||||
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);
|
||||
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 {AdTypeGood} = require('../models/adtypegood');
|
||||
const {StatusSkill} = require('../models/statusSkill');
|
||||
const {CatGrp} = require('../models/catgrp');
|
||||
|
||||
await Sector.deleteMany({});
|
||||
await SectorGood.deleteMany({});
|
||||
@@ -949,6 +950,7 @@ async function eseguiDbOp(idapp, mydata, locale) {
|
||||
await AdType.deleteMany({});
|
||||
await AdTypeGood.deleteMany({});
|
||||
await StatusSkill.deleteMany({});
|
||||
await CatGrp.deleteMany({});
|
||||
|
||||
ris = await populate.popolaTabelleNuove();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user