- Modifiche a ProductInfo... Continua

This commit is contained in:
Surya Paolo
2025-08-29 23:34:08 +02:00
parent 2ee710b748
commit fcbc64cea8
24 changed files with 1006 additions and 1010 deletions

View File

@@ -526,19 +526,6 @@ router.post('/:userId/gestord', authenticate, async function (req, res, next) {
preserveNullAndEmptyArrays: true,
},
},
{
$lookup: {
from: 'productinfos',
localField: 'product.idProductInfo',
foreignField: '_id',
as: 'productInfo',
},
},
{
$unwind: {
path: '$productInfo',
},
},
{
$lookup: {
from: 'gasordines',
@@ -588,13 +575,13 @@ router.post('/:userId/gestord', authenticate, async function (req, res, next) {
$group: {
_id: '$product._id',
name: {
$first: '$productInfo.name',
$first: '$product.productInfo.name',
},
weight: {
$first: '$productInfo.weight',
$first: '$product.productInfo.weight',
},
unit: {
$first: '$productInfo.unit',
$first: '$product.productInfo.unit',
},
price_acquistato: {
$first: '$product.price_acquistato',