- 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:
@@ -48,7 +48,7 @@ module.exports.findAllIdApp = async function (idapp) {
|
||||
return await Publisher.find(myfind).sort({ name: 1 }).lean();
|
||||
};
|
||||
|
||||
module.exports.getEditoriWithTitleCount = async function (idapp) {
|
||||
module.exports.getEditoriWithTitleCount = async function (idapp, updatedata) {
|
||||
try {
|
||||
|
||||
const myquery = [
|
||||
@@ -95,11 +95,13 @@ module.exports.getEditoriWithTitleCount = async function (idapp) {
|
||||
|
||||
const result = await Publisher.aggregate(myquery);
|
||||
|
||||
for (const record of result) {
|
||||
await Publisher.updateOne(
|
||||
{ _id: record._id },
|
||||
{ $set: { quanti: record.quanti } }
|
||||
);
|
||||
if (updatedata) {
|
||||
for (const record of result) {
|
||||
await Publisher.updateOne(
|
||||
{ _id: record._id },
|
||||
{ $set: { quanti: record.quanti } }
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
|
||||
Reference in New Issue
Block a user