@nuskin/ns-product-lib 2.6.0 → 2.6.1-cx24-3608.1
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +8 -0
- package/package.json +1 -1
- package/src/productData.js +6 -6
package/CHANGELOG.md
CHANGED
@@ -1,3 +1,11 @@
|
|
1
|
+
## [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
|
+
|
3
|
+
|
4
|
+
### Fix
|
5
|
+
|
6
|
+
* imageURL issue when product is kit ([2a68af6](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/2a68af668a2ca0835a4b0d0995117ea8ab019bed))
|
7
|
+
* imageURL issue when product is kit ([656505a](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/656505a32421ae4e5d8e29dd451b68b24e72f30d))
|
8
|
+
|
1
9
|
# [2.6.0](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v2.5.2...v2.6.0) (2023-03-13)
|
2
10
|
|
3
11
|
|
package/package.json
CHANGED
package/src/productData.js
CHANGED
@@ -53,10 +53,10 @@ const ProductData = {
|
|
53
53
|
* @param {ConfigMap} config
|
54
54
|
* @returns
|
55
55
|
*/
|
56
|
-
searchEquinoxProduct: async function(skus, locale, config) {
|
56
|
+
searchEquinoxProduct: async function (skus, locale, config) {
|
57
57
|
let skuFilter = [];
|
58
58
|
|
59
|
-
if(Array.isArray(skus)) {
|
59
|
+
if (Array.isArray(skus)) {
|
60
60
|
skus.forEach((sku) => {
|
61
61
|
skuFilter.push(`index_key_productId="${sku}" OR index_key_skuId="${sku}"`)
|
62
62
|
})
|
@@ -133,7 +133,7 @@ const ProductData = {
|
|
133
133
|
const regex = /\d+\.\d+/
|
134
134
|
let thumbnailImage = ''
|
135
135
|
|
136
|
-
if (imageURL.includes('contentstack')) {
|
136
|
+
if (imageURL && imageURL.includes('contentstack')) {
|
137
137
|
thumbnailImage = imageURL + '?width=40'
|
138
138
|
} else {
|
139
139
|
thumbnailImage = imageURL.replace(regex, '40.40')
|
@@ -355,7 +355,7 @@ const ProductData = {
|
|
355
355
|
const regex = /\d+\.\d+/
|
356
356
|
let thumbnailImage = ''
|
357
357
|
|
358
|
-
if (imageURL.includes('contentstack')) {
|
358
|
+
if (imageURL && imageURL.includes('contentstack')) {
|
359
359
|
thumbnailImage = imageURL + '?width=40'
|
360
360
|
} else {
|
361
361
|
thumbnailImage = imageURL.replace(regex, '40.40')
|
@@ -494,7 +494,7 @@ const ProductData = {
|
|
494
494
|
* fetchChildSkus make requests to Equinox to get the SKUs of a kit.
|
495
495
|
* @param {*} product
|
496
496
|
*/
|
497
|
-
fetchChildSkus: async function(product) {
|
497
|
+
fetchChildSkus: async function (product) {
|
498
498
|
if (product.type === productTypes.kit) {
|
499
499
|
const config = getCachedConfigurations(['Equinox_Markets']).Equinox_Markets;
|
500
500
|
const { skukits } = product.properties;
|
@@ -526,7 +526,7 @@ const ProductData = {
|
|
526
526
|
return [];
|
527
527
|
},
|
528
528
|
|
529
|
-
buildChildSkus: function(kits, product) {
|
529
|
+
buildChildSkus: function (kits, product) {
|
530
530
|
const sku = product.sku[0];
|
531
531
|
const kit = kits.filter(k => k.sku === sku.identifier)[0];
|
532
532
|
|