@nuskin/ns-product-lib 2.13.0-cx24-5107.16 → 2.13.0-cx24-5107.17

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.13.0-cx24-5107.17](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v2.13.0-cx24-5107.16...v2.13.0-cx24-5107.17) (2023-10-19)
2
+
3
+
4
+ ### Fix
5
+
6
+ * product images array instead of obj ([26b7786](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/26b77867ea0dbc6bf1ab482535d8f3d823eb3e8e))
7
+
1
8
  # [2.13.0-cx24-5107.16](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v2.13.0-cx24-5107.15...v2.13.0-cx24-5107.16) (2023-10-19)
2
9
 
3
10
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nuskin/ns-product-lib",
3
- "version": "2.13.0-cx24-5107.16",
3
+ "version": "2.13.0-cx24-5107.17",
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": {
@@ -355,14 +355,15 @@ function mapProductImages(product) {
355
355
  thumbnail: ""
356
356
  };
357
357
 
358
- if (product.productImages) {
359
- productImages.fullImage = product.productImages.url || '';
360
- productImages.imageAltText = product.productImages.alt || '';
361
- productImages.thumbnail = product.productImages.thumbnail || '';
358
+ if (product.productImages && product.productImages.length) {
359
+ productImages.fullImage = product.productImages[0].url || '';
360
+ productImages.imageAltText = product.productImages[0].alt || '';
361
+ productImages.thumbnail = product.productImages[0].thumbnail || '';
362
362
  }
363
363
 
364
364
  return productImages;
365
365
  }
366
+
366
367
  /**
367
368
  * Map Order Types
368
369
  * @param {Array<string>} availableChannels