@nuskin/ns-product-lib 2.15.1 → 2.15.2-cx24-6768.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
@@ -351,19 +351,23 @@ function mapChildSKU(kitBundleProducts) {
|
|
351
351
|
|
352
352
|
return kitBundleProducts.kitProducts.map((kitProduct) => {
|
353
353
|
const { product } = kitProduct;
|
354
|
-
const
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
354
|
+
const arr1 = []
|
355
|
+
for (const variant of product.variants) {
|
356
|
+
arr1.push({
|
357
|
+
productId: product.id,
|
358
|
+
skuId: variant.sku,
|
359
|
+
type: 'MANDATORY',
|
360
|
+
skuQuantity: variant.availableQuantity,
|
361
|
+
// eslint-disable-next-line max-len
|
362
|
+
availableChannels: Array.isArray(kitBundleProducts.availableChannels) ? kitBundleProducts.availableChannels.join(',') : kitBundleProducts.availableChannels,
|
363
|
+
inventory: {
|
364
|
+
atpQty: variant.availableQuantity,
|
365
|
+
backOrdered: variant.status.isBackordered,
|
366
|
+
backOrderedQty: variant.availableQuantity
|
367
|
+
}
|
368
|
+
})
|
366
369
|
}
|
370
|
+
return Object.assign({}, arr1)
|
367
371
|
});
|
368
372
|
}
|
369
373
|
|