@nuskin/ns-product-lib 2.6.0 → 2.6.1-cx24-3608.2
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/CHANGELOG.md +15 -0
- package/package.json +1 -1
- package/src/productData.js +7 -6
package/CHANGELOG.md
CHANGED
@@ -1,3 +1,18 @@
|
|
1
|
+
## [2.6.1-cx24-3608.2](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v2.6.1-cx24-3608.1...v2.6.1-cx24-3608.2) (2023-03-15)
|
2
|
+
|
3
|
+
|
4
|
+
### Fix
|
5
|
+
|
6
|
+
* imageURL issue when product is kit ([3172244](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/3172244e53c328e90d663a0989c25c25eba967d3))
|
7
|
+
|
8
|
+
## [2.6.1-cx24-3608.1](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v2.6.0...v2.6.1-cx24-3608.1) (2023-03-15)
|
9
|
+
|
10
|
+
|
11
|
+
### Fix
|
12
|
+
|
13
|
+
* imageURL issue when product is kit ([2a68af6](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/2a68af668a2ca0835a4b0d0995117ea8ab019bed))
|
14
|
+
* imageURL issue when product is kit ([656505a](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/656505a32421ae4e5d8e29dd451b68b24e72f30d))
|
15
|
+
|
1
16
|
# [2.6.0](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v2.5.2...v2.6.0) (2023-03-13)
|
2
17
|
|
3
18
|
|
package/package.json
CHANGED
package/src/productData.js
CHANGED
@@ -53,10 +53,10 @@ const ProductData = {
|
|
53
53
|
* @param {ConfigMap} config
|
54
54
|
* @returns
|
55
55
|
*/
|
56
|
-
searchEquinoxProduct: async function(skus, locale, config) {
|
56
|
+
searchEquinoxProduct: async function (skus, locale, config) {
|
57
57
|
let skuFilter = [];
|
58
58
|
|
59
|
-
if(Array.isArray(skus)) {
|
59
|
+
if (Array.isArray(skus)) {
|
60
60
|
skus.forEach((sku) => {
|
61
61
|
skuFilter.push(`index_key_productId="${sku}" OR index_key_skuId="${sku}"`)
|
62
62
|
})
|
@@ -129,7 +129,7 @@ const ProductData = {
|
|
129
129
|
*/
|
130
130
|
eqProductVariantMapper: function (eqVariant) {
|
131
131
|
|
132
|
-
let imageURL = eqVariant.properties.imageURL;
|
132
|
+
let imageURL = eqVariant.properties.imageURL ? eqVariant.properties.imageURL : '';
|
133
133
|
const regex = /\d+\.\d+/
|
134
134
|
let thumbnailImage = ''
|
135
135
|
|
@@ -139,6 +139,7 @@ const ProductData = {
|
|
139
139
|
thumbnailImage = imageURL.replace(regex, '40.40')
|
140
140
|
}
|
141
141
|
|
142
|
+
|
142
143
|
const { eventName, eventLabels, computedPrice, defaultProductPrice } = this.getEqProductPromotions(eqVariant);
|
143
144
|
const productPrice = eventName ? defaultProductPrice : eqVariant.priceFacets["Regular Price"];
|
144
145
|
const discountedPrice = eventName ? computedPrice : eqVariant.priceFacets["Regular Price"];
|
@@ -351,7 +352,7 @@ const ProductData = {
|
|
351
352
|
|
352
353
|
for (const productData of productDataResponse) {
|
353
354
|
let product = (productData.type && productData.type === "kit") ? productData : productData.sku[count];
|
354
|
-
let imageURL = product.properties.imageURL;
|
355
|
+
let imageURL = product.properties.imageURL ? product.properties.imageURL : '';
|
355
356
|
const regex = /\d+\.\d+/
|
356
357
|
let thumbnailImage = ''
|
357
358
|
|
@@ -494,7 +495,7 @@ const ProductData = {
|
|
494
495
|
* fetchChildSkus make requests to Equinox to get the SKUs of a kit.
|
495
496
|
* @param {*} product
|
496
497
|
*/
|
497
|
-
fetchChildSkus: async function(product) {
|
498
|
+
fetchChildSkus: async function (product) {
|
498
499
|
if (product.type === productTypes.kit) {
|
499
500
|
const config = getCachedConfigurations(['Equinox_Markets']).Equinox_Markets;
|
500
501
|
const { skukits } = product.properties;
|
@@ -526,7 +527,7 @@ const ProductData = {
|
|
526
527
|
return [];
|
527
528
|
},
|
528
529
|
|
529
|
-
buildChildSkus: function(kits, product) {
|
530
|
+
buildChildSkus: function (kits, product) {
|
530
531
|
const sku = product.sku[0];
|
531
532
|
const kit = kits.filter(k => k.sku === sku.identifier)[0];
|
532
533
|
|