@nuskin/ns-product-lib
Advanced tools
Comparing version 2.17.1-cx24-67682.1 to 2.17.1-cx24-67682.2
{ | ||
"name": "@nuskin/ns-product-lib", | ||
"version": "2.17.1-cx24-67682.1", | ||
"version": "2.17.1-cx24-67682.2", | ||
"description": "This project contains shared Product models and code between the backend and frontend.", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
@@ -441,22 +441,36 @@ const axios = require('axios').default; | ||
} | ||
return kitBundleProducts.kitProducts.map((kitProduct) => { | ||
const { product } = kitProduct; | ||
const arr1 = [] | ||
for (const variant of product.variants) { | ||
arr1.push({ | ||
if (product.variants.length > 1) { | ||
for (const variant of product.variants) { | ||
return { | ||
productId: product.id, | ||
skuId: variant.sku, | ||
type: 'MANDATORY', | ||
skuQuantity: variant.availableQuantity, | ||
// eslint-disable-next-line max-len | ||
availableChannels: Array.isArray(kitBundleProducts.availableChannels) ? kitBundleProducts.availableChannels.join(',') : kitBundleProducts.availableChannels, | ||
inventory: { | ||
atpQty: variant.availableQuantity, | ||
backOrdered: variant.status.isBackordered, | ||
backOrderedQty: variant.availableQuantity | ||
} | ||
} | ||
} | ||
} else { | ||
const defaultVariant = product.variants[0]; | ||
return { | ||
productId: product.id, | ||
skuId: variant.sku, | ||
skuId: defaultVariant.sku, | ||
type: 'MANDATORY', | ||
skuQuantity: variant.availableQuantity, | ||
// eslint-disable-next-line max-len | ||
skuQuantity: kitProduct.quantity, | ||
availableChannels: Array.isArray(kitBundleProducts.availableChannels) ? kitBundleProducts.availableChannels.join(',') : kitBundleProducts.availableChannels, | ||
inventory: { | ||
atpQty: variant.availableQuantity, | ||
backOrdered: variant.status.isBackordered, | ||
backOrderedQty: variant.availableQuantity | ||
atpQty: defaultVariant.availableQuantity, | ||
backOrdered: defaultVariant.status.isBackordered, | ||
backOrderedQty: defaultVariant.availableQuantity | ||
} | ||
}) | ||
} | ||
} | ||
return Object.assign({}, arr1) | ||
}); | ||
@@ -463,0 +477,0 @@ } |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
146584
4932