- newsletter: prende la lista utenti (flag news_on)

- Abilita a Tutti la Newsletter news_on
- isCommerciale
- JobsInProgress
- PCB: Corretto Totali che era a zero
This commit is contained in:
Surya Paolo
2025-05-06 18:19:09 +02:00
parent 6e8d1fcff1
commit b77a0579f1
30 changed files with 4669 additions and 727 deletions

View File

@@ -20,6 +20,7 @@ const CollanaSchema = new Schema({
},
title: {
type: String,
index: true,
},
dataOra: {
type: Date,
@@ -55,7 +56,7 @@ module.exports.findAllIdApp = async function (idapp) {
return await Collana.find(myfind).sort({title: 1}).lean();
};
module.exports.getCollaneWithTitleCount = async function (idapp) {
module.exports.getCollaneWithTitleCount = async function (idapp, updatedata) {
try {
const myquery = [
@@ -104,11 +105,13 @@ module.exports.getCollaneWithTitleCount = async function (idapp) {
const result = await Collana.aggregate(myquery);
for (const record of result) {
await Collana.updateOne(
{ _id: record._id },
{ $set: { quanti: record.quanti } }
);
if (updatedata) {
for (const record of result) {
await Collana.updateOne(
{ _id: record._id },
{ $set: { quanti: record.quanti } }
);
}
}
return result;