ver: 1.1.21:
- Lista dei Cataloghi - Gestione Cataloghi in base alla configurazione
This commit is contained in:
@@ -220,7 +220,7 @@ router.post(process.env.LINK_REQUEST_NEWPASSWORD, async (req, res) => {
|
||||
// Invio la Nuova Password richiesta dal reset!
|
||||
// Ritorna il token per poter effettuare le chiamate...
|
||||
router.post(process.env.LINK_UPDATE_PWD, async (req, res) => {
|
||||
|
||||
|
||||
try {
|
||||
const body = _.pick(req.body, ['idapp', 'email', 'tokenforgot', 'tokenforgot_code', 'password']);
|
||||
const idapp = body.idapp;
|
||||
@@ -229,7 +229,7 @@ router.post(process.env.LINK_UPDATE_PWD, async (req, res) => {
|
||||
const tokenforgot_code = body.tokenforgot_code;
|
||||
const password = body.password;
|
||||
const msg = 'Richiesta Nuova Password: idapp= ' + idapp + ' email = ' + email;
|
||||
|
||||
|
||||
console.log(msg);
|
||||
|
||||
// telegrambot.sendMsgTelegramToTheManagers(body.idapp, msg);
|
||||
@@ -668,6 +668,32 @@ router.post('/setsubrec', authenticate, (req, res) => {
|
||||
|
||||
});
|
||||
|
||||
router.post('/getobj', authenticate_noerror, async (req, res) => {
|
||||
|
||||
try {
|
||||
let cmd = req.body.cmd;
|
||||
let idapp = req.user ? req.user.idapp : sanitizeHtml(req.body.idapp); // Cambiato from params.idapp a req.body.idapp
|
||||
let ris = null;
|
||||
|
||||
if (cmd === 'lista_editori') {
|
||||
ris = await User.find(
|
||||
{
|
||||
idapp,
|
||||
perm: { $bitsAnySet: 0b10000 },
|
||||
},
|
||||
{ username: 1, name: 1, surname: 1 }
|
||||
).lean();
|
||||
}
|
||||
|
||||
// Invia la risposta
|
||||
res.status(200).send({ code: server_constants.RIS_CODE_OK, data: ris });
|
||||
|
||||
} catch (e) {
|
||||
console.error(`ERROR getobj ${cmd}: `, e.message);
|
||||
res.status(200).send({ code: server_constants.RIS_CODE_OK, data: [] });
|
||||
}
|
||||
});
|
||||
|
||||
router.post('/gettable', authenticate_noerror, (req, res) => {
|
||||
let params = req.body;
|
||||
|
||||
@@ -868,17 +894,21 @@ async function duplicatePage(pageId, newpath) {
|
||||
|
||||
const catalogo = elem.catalogo;
|
||||
|
||||
for (const recscheda of catalogo.arrSchede) {
|
||||
if (recscheda.scheda?.isTemplate) {
|
||||
// Se è un template allora devo mettergli un altro ID !
|
||||
recscheda.scheda._id = new mongoose.Types.ObjectId();
|
||||
// recscheda.scheda.name = getNewFreeNameTemplate(recscheda.scheda?.name)
|
||||
if (catalogo) {
|
||||
|
||||
for (const recscheda of catalogo.arrSchede) {
|
||||
if (recscheda.scheda?.isTemplate) {
|
||||
// Se è un template allora devo mettergli un altro ID !
|
||||
recscheda.scheda._id = new mongoose.Types.ObjectId();
|
||||
// recscheda.scheda.name = getNewFreeNameTemplate(recscheda.scheda?.name)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
let newelem = { ...elem };
|
||||
|
||||
elem.catalogo = { ...catalogo };
|
||||
if (catalogo)
|
||||
elem.catalogo = { ...catalogo };
|
||||
|
||||
const newElem = new MyElem({
|
||||
...elem, // Copia le proprietà dell'elemento
|
||||
|
||||
Reference in New Issue
Block a user