@nuskin/ns-product-lib 2.19.3-pur-1420.2 → 2.19.4
Sign up to get free protection for your applications and to get access to all the features.
- package/package.json +3 -3
- package/src/graph-ql/product.js +7 -4
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@nuskin/ns-product-lib",
|
3
|
-
"version": "2.19.
|
3
|
+
"version": "2.19.4",
|
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": {
|
@@ -19,7 +19,7 @@
|
|
19
19
|
"license": "ISC",
|
20
20
|
"homepage": "https://code.tls.nuskin.io/ns-am/product/js-libs/ns-product-lib/blob/master/README.md",
|
21
21
|
"devDependencies": {
|
22
|
-
"@nuskin/configuration-sdk": "
|
22
|
+
"@nuskin/configuration-sdk": "3.0.0",
|
23
23
|
"@nuskin/ns-common-lib": "1.4.7",
|
24
24
|
"@nuskin/ns-util": "4.5.4",
|
25
25
|
"@nuskin/product-lib": "2.2.1",
|
@@ -36,7 +36,7 @@
|
|
36
36
|
"prettier": "1.19.1"
|
37
37
|
},
|
38
38
|
"peerDependencies": {
|
39
|
-
"@nuskin/configuration-sdk": "
|
39
|
+
"@nuskin/configuration-sdk": "3.x",
|
40
40
|
"@nuskin/ns-common-lib": "1.x",
|
41
41
|
"@nuskin/ns-util": "4.x",
|
42
42
|
"axios": "1.6.7"
|
package/src/graph-ql/product.js
CHANGED
@@ -651,7 +651,8 @@ function mapProductStatus(status) {
|
|
651
651
|
|
652
652
|
/* istanbul ignore next */
|
653
653
|
function mapPromos(product) {
|
654
|
-
if ((product.price.retailSales !== null && product.price.retailSales >= 0) ||
|
654
|
+
if ((product.price.retailSales !== null && product.price.retailSales >= 0) ||
|
655
|
+
(product.price.wholesaleSales !== null && product.price.wholesaleSales >= 0)) {
|
655
656
|
if (product.pricingJson) {
|
656
657
|
const parsedPricing = JSON.parse(product.pricingJson)
|
657
658
|
let promotion = parsedPricing.promotion
|
@@ -671,8 +672,10 @@ function mapPromos(product) {
|
|
671
672
|
if (parsedPricing.retail) {
|
672
673
|
const filter = ['adr', 'order', 'webAdr', 'webOrder']
|
673
674
|
const priceMap = {}, cvMap = {}, pvMap = {}
|
674
|
-
const retailActiveEvents =
|
675
|
-
|
675
|
+
const retailActiveEvents =
|
676
|
+
Object.fromEntries(Object.entries(parsedPricing.retail).filter(([k]) => !filter.includes(k)));
|
677
|
+
const wholesaleActiveEvents =
|
678
|
+
Object.fromEntries(Object.entries(parsedPricing.wholesale).filter(([k]) => !filter.includes(k)));
|
676
679
|
let offerId = null
|
677
680
|
for (const key in retailActiveEvents) {
|
678
681
|
if (Object.hasOwnProperty.call(retailActiveEvents, key)) {
|
@@ -694,7 +697,7 @@ function mapPromos(product) {
|
|
694
697
|
}
|
695
698
|
return { message: product.salesLabel, offerId: null, priceMap: {}, cvMap: {}, pvMap: {} }
|
696
699
|
}
|
697
|
-
return {message:
|
700
|
+
return {message: product.salesLabel, offerId: null}
|
698
701
|
}
|
699
702
|
|
700
703
|
/* istanbul ignore next */
|