tango-app-api-store-builder 1.0.0-beta-157 → 1.0.0-beta-158
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1451,6 +1451,8 @@ export async function updateMissing( req, res ) {
|
|
|
1451
1451
|
|
|
1452
1452
|
if ( !fixtureShelves.length ) return res.sendError( 'No shelves found for the fixture', 204 );
|
|
1453
1453
|
|
|
1454
|
+
console.log('called')
|
|
1455
|
+
|
|
1454
1456
|
await Promise.all(
|
|
1455
1457
|
fixtureShelves.map( async ( shelf ) => {
|
|
1456
1458
|
const productMappings = await planoMappingService.find( { shelfId: shelf._id } );
|
|
@@ -1459,18 +1461,18 @@ export async function updateMissing( req, res ) {
|
|
|
1459
1461
|
return { ...shelf.toObject(), products: [] };
|
|
1460
1462
|
}
|
|
1461
1463
|
|
|
1462
|
-
const productIds = productMappings.map( ( mapping ) => mapping.productId );
|
|
1463
|
-
const products = await planoProductService.find( { _id: { $in: productIds } } );
|
|
1464
|
-
const productMap = new Map( products.map( ( product ) => [ product._id.toString(), product.toObject() ] ) );
|
|
1464
|
+
// const productIds = productMappings.map( ( mapping ) => mapping.productId );
|
|
1465
|
+
// const products = await planoProductService.find( { _id: { $in: productIds } } );
|
|
1466
|
+
// const productMap = new Map( products.map( ( product ) => [ product._id.toString(), product.toObject() ] ) );
|
|
1465
1467
|
|
|
1466
1468
|
const currentDate = new Date( dayjs().format( 'YYYY-MM-DD' ) );
|
|
1467
1469
|
|
|
1468
1470
|
await Promise.all(
|
|
1469
1471
|
productMappings.map( async ( mapping ) => {
|
|
1470
|
-
const productData = productMap.get( mapping?.productId?.toString() );
|
|
1471
|
-
if ( !productData ) {
|
|
1472
|
-
|
|
1473
|
-
}
|
|
1472
|
+
// const productData = productMap.get( mapping?.productId?.toString() );
|
|
1473
|
+
// if ( !productData ) {
|
|
1474
|
+
// return { ...mapping.toObject(), status: '' };
|
|
1475
|
+
// }
|
|
1474
1476
|
|
|
1475
1477
|
const mappingCompliance = await planoComplianceService.findOne( {
|
|
1476
1478
|
planoMappingId: mapping._id,
|
|
@@ -1484,7 +1486,7 @@ export async function updateMissing( req, res ) {
|
|
|
1484
1486
|
|
|
1485
1487
|
return {
|
|
1486
1488
|
...mapping.toObject(),
|
|
1487
|
-
...productData,
|
|
1489
|
+
// ...productData,
|
|
1488
1490
|
};
|
|
1489
1491
|
} ),
|
|
1490
1492
|
);
|