@nuskin/ns-product-lib 2.13.0-cx24-5107.5 → 2.13.0-cx24-5107.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +15 -0
- package/package.json +1 -1
- package/src/graph-ql/product.js +5 -3
package/CHANGELOG.md
CHANGED
@@ -1,3 +1,18 @@
|
|
1
|
+
# [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)
|
2
|
+
|
3
|
+
|
4
|
+
### Fix
|
5
|
+
|
6
|
+
* single variant ([91fc1c4](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/91fc1c40aa0ac055b330373983f0055d8455176c))
|
7
|
+
|
8
|
+
# [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)
|
9
|
+
|
10
|
+
|
11
|
+
### Fix
|
12
|
+
|
13
|
+
* added productData count ([4896fc3](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/4896fc38b9ac841de4ac825659d58500c3bd360b))
|
14
|
+
* remove config log ([72739a9](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/commit/72739a9a893ccfa8b3ca76056eab088f5dddef28))
|
15
|
+
|
1
16
|
# [2.13.0-cx24-5107.5](https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/compare/v2.13.0-cx24-5107.4...v2.13.0-cx24-5107.5) (2023-09-28)
|
2
17
|
|
3
18
|
|
package/package.json
CHANGED
package/src/graph-ql/product.js
CHANGED
@@ -53,9 +53,11 @@ async function getProduct(id, market, locale, config) {
|
|
53
53
|
if (data && data.data && data.data.productById) {
|
54
54
|
const product = mapProduct(data.data.productById, market, locale, config);
|
55
55
|
productData.products.push(new Product(product));
|
56
|
+
productData.count = productData.products.length;
|
56
57
|
}
|
58
|
+
|
57
59
|
} catch (e) {
|
58
|
-
console.log(
|
60
|
+
console.log(`Unable to fetch product detail for SKU ${id}`);
|
59
61
|
}
|
60
62
|
|
61
63
|
return {
|
@@ -193,7 +195,7 @@ function mapProduct(product, market, locale, config) {
|
|
193
195
|
function mapVariants(product) {
|
194
196
|
|
195
197
|
//return if it has no variant
|
196
|
-
if (!product.variants) {
|
198
|
+
if (!product.variants || (product.variants && product.variants.length === 1)) {
|
197
199
|
return [];
|
198
200
|
}
|
199
201
|
|
@@ -274,7 +276,7 @@ function mapVariants(product) {
|
|
274
276
|
* @returns {object} promotion
|
275
277
|
*/
|
276
278
|
function getPromotions(config) {
|
277
|
-
console.log(`
|
279
|
+
console.log(`store ID : `, config.store_id);
|
278
280
|
return null;
|
279
281
|
}
|
280
282
|
|