- ordinamento aggiornare la pagina "templates" per Fatturati ultimo anno
- bestseller
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user