@zeniai/client-epic-state 4.12.35 → 4.12.36

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.
@@ -15,10 +15,13 @@ const globalMerchantSelector_1 = require("../../../../entity/globalMerchant/glob
15
15
  const globalMerchantState_1 = require("../../../../entity/globalMerchant/globalMerchantState");
16
16
  const commonTypes_1 = require("../../common/state/commonTypes");
17
17
  const commonTypes_2 = require("../../common/payload/commonTypes");
18
+ const vendorGlobalReviewViewSelector_1 = require("../vendorGlobalReviewViewSelector");
18
19
  const approveVendorGlobalReviewEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(vendorGlobalReviewViewReducer_1.approveVendorGlobalReview.match), (0, operators_1.mergeMap)((action) => {
19
20
  const { merchantId } = action.payload;
20
21
  const { globalMerchantState, vendorGlobalReviewViewState } = state$.value;
21
22
  const { vendorGlobalByMerchantId } = vendorGlobalReviewViewState;
23
+ const globalSelectorView = (0, vendorGlobalReviewViewSelector_1.getVendorGlobalReviewView)(state$.value);
24
+ const merchantSelectorView = globalSelectorView.vendorGlobalReviewData.find((merchant) => merchant.merchant.tenantMerchantId === merchantId);
22
25
  const merchantData = vendorGlobalByMerchantId[merchantId].vendorGlobalReviewViewLocalData;
23
26
  const selectedMerchant = merchantData != null && merchantData.selectedMerchantId != null
24
27
  ? (0, globalMerchantSelector_1.getGlobalMerchantByMerchantId)(globalMerchantState, merchantData.selectedMerchantId)
@@ -29,21 +32,17 @@ const approveVendorGlobalReviewEpic = (actions$, state$, zeniAPI) => actions$.pi
29
32
  if (selectedMerchantName == null &&
30
33
  (merchantData.currentSelection === 'recommendedFirst' ||
31
34
  merchantData.currentSelection === 'recommendedSecond')) {
32
- if (merchantData.currentSelection === 'recommendedFirst' &&
33
- merchantData.recommendedNonExistingGlobalMerchants.length > 0) {
35
+ if (merchantData.currentSelection === 'recommendedFirst') {
34
36
  selectedMerchantName =
35
- merchantData.recommendedNonExistingGlobalMerchants[0]
36
- .globalMerchantName;
37
+ merchantSelectorView === null || merchantSelectorView === void 0 ? void 0 : merchantSelectorView.recommendations[0].globalMerchantName;
37
38
  selectedNonExistingGlobalMerchant =
38
- merchantData.recommendedNonExistingGlobalMerchants[0];
39
+ merchantSelectorView === null || merchantSelectorView === void 0 ? void 0 : merchantSelectorView.recommendations[0];
39
40
  }
40
- else if (merchantData.currentSelection === 'recommendedSecond' &&
41
- merchantData.recommendedNonExistingGlobalMerchants.length > 1) {
41
+ else if (merchantData.currentSelection === 'recommendedSecond') {
42
42
  selectedMerchantName =
43
- merchantData.recommendedNonExistingGlobalMerchants[1]
44
- .globalMerchantName;
43
+ merchantSelectorView === null || merchantSelectorView === void 0 ? void 0 : merchantSelectorView.recommendations[1].globalMerchantName;
45
44
  selectedNonExistingGlobalMerchant =
46
- merchantData.recommendedNonExistingGlobalMerchants[1];
45
+ merchantSelectorView === null || merchantSelectorView === void 0 ? void 0 : merchantSelectorView.recommendations[1];
47
46
  }
48
47
  }
49
48
  if (merchantData != null &&
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zeniai/client-epic-state",
3
- "version": "4.12.35",
3
+ "version": "4.12.36",
4
4
  "description": "Shared module between Web & Mobile containing required abstractions for state management, async network communication. ",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",