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

Sign up to get free protection for your applications and to get access to all the features.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,17 @@
1
+ ## [2.6.1-cx24-3608.3](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v2.6.1-cx24-3608.2...v2.6.1-cx24-3608.3) (2023-03-15)
2
+
3
+
4
+ ### Fix
5
+
6
+ * imageURL issue when product is kit ([0e4281d](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/0e4281de4435d1a5749ff9b6d52a7c4a45d75d6d))
7
+
8
+ ## [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)
9
+
10
+
11
+ ### Fix
12
+
13
+ * imageURL issue when product is kit ([3172244](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/3172244e53c328e90d663a0989c25c25eba967d3))
14
+
1
15
  ## [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
16
 
3
17
 
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.3",
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,14 +129,16 @@ 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')) {
137
- thumbnailImage = imageURL + '?width=40'
138
- } else {
139
- thumbnailImage = imageURL.replace(regex, '40.40')
136
+ if (imageURL) {
137
+ if (imageURL.includes('contentstack')) {
138
+ thumbnailImage = imageURL + '?width=40'
139
+ } else {
140
+ thumbnailImage = imageURL.replace(regex, '40.40')
141
+ }
140
142
  }
141
143
 
142
144
  const { eventName, eventLabels, computedPrice, defaultProductPrice } = this.getEqProductPromotions(eqVariant);
@@ -351,14 +353,16 @@ const ProductData = {
351
353
 
352
354
  for (const productData of productDataResponse) {
353
355
  let product = (productData.type && productData.type === "kit") ? productData : productData.sku[count];
354
- let imageURL = product.properties.imageURL;
356
+ let imageURL = product.properties.imageURL ? product.properties.imageURL : '';
355
357
  const regex = /\d+\.\d+/
356
358
  let thumbnailImage = ''
357
359
 
358
- if (imageURL && imageURL.includes('contentstack')) {
359
- thumbnailImage = imageURL + '?width=40'
360
- } else {
361
- thumbnailImage = imageURL.replace(regex, '40.40')
360
+ if (imageURL) {
361
+ if (imageURL.includes('contentstack')) {
362
+ thumbnailImage = imageURL + '?width=40'
363
+ } else {
364
+ thumbnailImage = imageURL.replace(regex, '40.40')
365
+ }
362
366
  }
363
367
 
364
368
  if (productData.sku && productData.sku.length > 1) {