@nuskin/ns-product-lib 2.17.0-cx24-5822.8 → 2.17.1-cx24-67682.1
Sign up to get free protection for your applications and to get access to all the features.
- package/package.json +1 -1
- package/src/graph-ql/product.js +16 -12
package/package.json
CHANGED
package/src/graph-ql/product.js
CHANGED
@@ -441,19 +441,23 @@ function mapChildSKU(kitBundleProducts) {
|
|
441
441
|
|
442
442
|
return kitBundleProducts.kitProducts.map((kitProduct) => {
|
443
443
|
const { product } = kitProduct;
|
444
|
-
const
|
445
|
-
|
446
|
-
|
447
|
-
|
448
|
-
|
449
|
-
|
450
|
-
|
451
|
-
|
452
|
-
|
453
|
-
|
454
|
-
|
455
|
-
|
444
|
+
const arr1 = []
|
445
|
+
for (const variant of product.variants) {
|
446
|
+
arr1.push({
|
447
|
+
productId: product.id,
|
448
|
+
skuId: variant.sku,
|
449
|
+
type: 'MANDATORY',
|
450
|
+
skuQuantity: variant.availableQuantity,
|
451
|
+
// eslint-disable-next-line max-len
|
452
|
+
availableChannels: Array.isArray(kitBundleProducts.availableChannels) ? kitBundleProducts.availableChannels.join(',') : kitBundleProducts.availableChannels,
|
453
|
+
inventory: {
|
454
|
+
atpQty: variant.availableQuantity,
|
455
|
+
backOrdered: variant.status.isBackordered,
|
456
|
+
backOrderedQty: variant.availableQuantity
|
457
|
+
}
|
458
|
+
})
|
456
459
|
}
|
460
|
+
return Object.assign({}, arr1)
|
457
461
|
});
|
458
462
|
}
|
459
463
|
|