- 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

@@ -24,6 +24,9 @@ const PublisherSchema = new Schema({
img: {
type: String,
},
quanti: {
type: Number,
},
});
var Publisher = module.exports = mongoose.model('Publisher', PublisherSchema);
@@ -92,6 +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 } }
);
}
return result;
} catch (error) {
console.error('Error retrieving idCollana with title count:', error);