@nuskin/ns-product-lib 2.6.1-cx24-3608.1 → 2.6.1-cx24-3608.2

Sign up to get free protection for your applications and to get access to all the features.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
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
+
1
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)
2
9
 
3
10
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nuskin/ns-product-lib",
3
- "version": "2.6.1-cx24-3608.1",
3
+ "version": "2.6.1-cx24-3608.2",
4
4
  "description": "This project contains shared Product models and code between the backend and frontend.",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -129,16 +129,17 @@ 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
 
136
- if (imageURL && imageURL.includes('contentstack')) {
136
+ if (imageURL.includes('contentstack')) {
137
137
  thumbnailImage = imageURL + '?width=40'
138
138
  } else {
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,11 +352,11 @@ 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
 
358
- if (imageURL && imageURL.includes('contentstack')) {
359
+ if (imageURL.includes('contentstack')) {
359
360
  thumbnailImage = imageURL + '?width=40'
360
361
  } else {
361
362
  thumbnailImage = imageURL.replace(regex, '40.40')