@nuskin/ns-product-lib 2.6.1-cx24-337701.11 → 2.6.1-cx24-337701.12

Sign up to get free protection for your applications and to get access to all the features.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ ## [2.6.1-cx24-337701.12](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v2.6.1-cx24-337701.11...v2.6.1-cx24-337701.12) (2023-03-20)
2
+
3
+
4
+ ### Fix
5
+
6
+ * The variant drop down label ([235a252](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/235a252cd59a94704400743e51d043d2ca2b9074))
7
+ * The variant drop down label ([e43614e](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/e43614ece7f3bb7d8c0d12743ab02b90427cbbb9))
8
+
1
9
  ## [2.6.1-cx24-337701.11](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v2.6.1-cx24-337701.10...v2.6.1-cx24-337701.11) (2023-03-20)
2
10
 
3
11
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nuskin/ns-product-lib",
3
- "version": "2.6.1-cx24-337701.11",
3
+ "version": "2.6.1-cx24-337701.12",
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": {
@@ -345,7 +345,7 @@ const ProductData = {
345
345
 
346
346
  moveArray: function (arr, from, to) {
347
347
  arr.splice(to, 0, arr.splice(from, 1)[0]);
348
- return arr;
348
+ return { arr };
349
349
  },
350
350
 
351
351
 
@@ -374,6 +374,10 @@ const ProductData = {
374
374
  variants[variant.identifier] = this.eqProductVariantMapper(variant);
375
375
  return variant;
376
376
  });
377
+
378
+ let defaultKey = productData.sku.map(e => e.default).indexOf(true)
379
+ if (defaultKey)
380
+ variants = this.moveArray(Object.values(variants), defaultKey, 0);
377
381
  }
378
382
 
379
383