@nuskin/ns-product-lib 2.13.0-cx24-5107.6 → 2.13.0-cx24-5107.8

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.13.0-cx24-5107.8](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v2.13.0-cx24-5107.7...v2.13.0-cx24-5107.8) (2023-10-03)
2
+
3
+
4
+ ### Fix
5
+
6
+ * variants label ([4d217a2](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/4d217a2e8c390cb12e5c3f379bd7296f10df20aa))
7
+
8
+ # [2.13.0-cx24-5107.7](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v2.13.0-cx24-5107.6...v2.13.0-cx24-5107.7) (2023-09-29)
9
+
10
+
11
+ ### Fix
12
+
13
+ * single variant ([91fc1c4](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/91fc1c40aa0ac055b330373983f0055d8455176c))
14
+
1
15
  # [2.13.0-cx24-5107.6](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v2.13.0-cx24-5107.5...v2.13.0-cx24-5107.6) (2023-09-29)
2
16
 
3
17
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nuskin/ns-product-lib",
3
- "version": "2.13.0-cx24-5107.6",
3
+ "version": "2.13.0-cx24-5107.8",
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": {
@@ -165,7 +165,6 @@ function mapProduct(product, market, locale, config) {
165
165
 
166
166
  //map only if it is normal product
167
167
  if (product.variants && !kitBundleProducts) {
168
- console.log(variants);
169
168
  productDetail.variants = mapVariants(product);
170
169
  }
171
170
 
@@ -195,7 +194,7 @@ function mapProduct(product, market, locale, config) {
195
194
  function mapVariants(product) {
196
195
 
197
196
  //return if it has no variant
198
- if (!product.variants) {
197
+ if (!product.variants || (product.variants && product.variants.length === 1)) {
199
198
  return [];
200
199
  }
201
200
 
@@ -248,7 +247,7 @@ function mapVariants(product) {
248
247
  "size": variant.size,
249
248
  "status": mapProductStatus(variant.status.status),
250
249
  "variantType": "Other",
251
- "variantDropdownLabel": product.variantSelectLabel || '',
250
+ "variantDropdownLabel": variant.variantLabel || '',
252
251
  "variantDropdownPlaceholder": "Select Type",
253
252
  "variantsLabel": variant.variantLabel || '',
254
253
  "variants": [],