- ordinamento aggiornare la pagina "templates" per Fatturati ultimo anno

- bestseller
This commit is contained in:
Surya Paolo
2025-05-02 10:10:11 +02:00
parent fcc3755c19
commit 192fd4706c
6 changed files with 32 additions and 3 deletions

View File

@@ -30,6 +30,9 @@ const CollanaSchema = new Schema({
enabledAlFresco: {
type: Boolean,
},
quanti: {
type: Number,
},
});
@@ -101,6 +104,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 } }
);
}
return result;
} catch (error) {
console.error('Error retrieving idCollana with title count:', error);