@nuskin/ns-product-lib 2.19.1 → 2.19.3-mdigi-326.1

Sign up to get free protection for your applications and to get access to all the features.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nuskin/ns-product-lib",
3
- "version": "2.19.1",
3
+ "version": "2.19.3-mdigi-326.1",
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": {
@@ -2,15 +2,15 @@ const { getEnvironmentFromUrl } = require('@nuskin/ns-common-lib');
2
2
 
3
3
  const config = {
4
4
  dev: {
5
- url: 'https://test.nuskin.com/product-api/graphql',
5
+ url: 'https://product.api.dev.nuskin.com/graphql',
6
6
  env: 'dev'
7
7
  },
8
8
  test: {
9
- url: 'https://test.nuskin.com/product-api/graphql',
9
+ url: 'https://product.api.test.nuskin.com/graphql',
10
10
  env: 'test'
11
11
  },
12
12
  prod: {
13
- url: 'https://nuskin.com/product-api/graphql',
13
+ url: 'https://product.api.nuskin.com/graphql',
14
14
  env: 'public'
15
15
  }
16
16
  };
@@ -169,8 +169,8 @@ function mapProduct(product, market, locale, config) {
169
169
  "availableQuantity": isBackOrdered ? kitOrVariant.backorderQuantity : kitOrVariant.atpQuantity,
170
170
  "maxQuantity": kitOrVariant.maxQuantity,
171
171
  "points": "",
172
- "cv": points.wholesale ? points.wholesale.cv : 0,
173
- "pv": points.wholesale ? points.wholesale.pv : 0,
172
+ "cv": points && points.wholesale ? points.wholesale.cv : 0,
173
+ "pv": points && points.wholesale ? points.wholesale.pv : 0,
174
174
  "priceType": "WRTL",
175
175
  "price": pricing.retail,
176
176
  "priceMap": {
@@ -187,15 +187,15 @@ function mapProduct(product, market, locale, config) {
187
187
  },
188
188
  "cvMap": {
189
189
  ...promoData.cvMap,
190
- "WWHL": points.wholesale ? points.wholesale.cv : 0,
191
- "WADW": points.subscription ? points.subscription.cv : 0,
192
- "WHL": points.wholesale ? points.wholesale.cv : 0
190
+ "WWHL": points && points.wholesale ? points.wholesale.cv : 0,
191
+ "WADW": points && points.subscription ? points.subscription.cv : 0,
192
+ "WHL": points && points.wholesale ? points.wholesale.cv : 0
193
193
  },
194
194
  "pvMap": {
195
195
  ...promoData.pvMap,
196
- "WWHL": points.wholesale ? points.wholesale.pv : 0,
197
- "WADW": points.subscription ? points.subscription.pv : 0,
198
- "WHL": points.wholesale ? points.wholesale.pv : 0
196
+ "WWHL": points && points.wholesale ? points.wholesale.pv : 0,
197
+ "WADW": points && points.subscription ? points.subscription.pv : 0,
198
+ "WHL": points && points.wholesale ? points.wholesale.pv : 0
199
199
  },
200
200
  "orderTypes": mapOrderTypes(kitOrVariant.availableChannels, kitOrVariant.purchaseTypes),
201
201
  "custTypes": mapCustomerTypes(kitOrVariant.customerTypes),
@@ -287,8 +287,8 @@ function mapVariants(product) {
287
287
  "availableQuantity": variant.availableQuantity,
288
288
  "maxQuantity": variant.maxQuantity,
289
289
  "points": "",
290
- "cv": points.wholesale ? points.wholesale.cv : 0,
291
- "pv": points.wholesale ? points.wholesale.pv : 0,
290
+ "cv": points && points.wholesale ? points.wholesale.cv : 0,
291
+ "pv": points && points.wholesale ? points.wholesale.pv : 0,
292
292
  "priceType": "WRTL",
293
293
  "price": pricing.retail,
294
294
  "priceMap": {
@@ -305,15 +305,15 @@ function mapVariants(product) {
305
305
  },
306
306
  "cvMap": {
307
307
  ...promoData.cvMap,
308
- "WWHL": points.wholesale ? points.wholesale.cv : 0,
309
- "WADW": points.subscription ? points.subscription.cv : 0,
310
- "WHL": points.wholesale ? points.wholesale.cv : 0
308
+ "WWHL": points && points.wholesale ? points.wholesale.cv : 0,
309
+ "WADW": points && points.subscription ? points.subscription.cv : 0,
310
+ "WHL": points && points.wholesale ? points.wholesale.cv : 0
311
311
  },
312
312
  "pvMap": {
313
313
  ...promoData.pvMap,
314
- "WWHL": points.wholesale ? points.wholesale.pv : 0,
315
- "WADW": points.subscription ? points.subscription.pv : 0,
316
- "WHL": points.wholesale ? points.wholesale.pv : 0
314
+ "WWHL": points && points.wholesale ? points.wholesale.pv : 0,
315
+ "WADW": points && points.subscription ? points.subscription.pv : 0,
316
+ "WHL": points && points.wholesale ? points.wholesale.pv : 0
317
317
  },
318
318
  "orderTypes": mapOrderTypes(variant.availableChannels, variant.purchaseTypes),
319
319
  "custTypes": mapCustomerTypes(variant.customerTypes),