@zeniai/client-epic-state 5.0.11 → 5.0.12-beta0ND

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.
@@ -59,7 +59,7 @@ const fetchBillDetailEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, ope
59
59
  response.data?.transaction?.transaction_id != null) {
60
60
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
61
61
  const transcationId = response.data.transaction.transaction_id;
62
- const vendorInResponse = response.data?.vendors[0];
62
+ const vendorInResponse = response.data?.vendors?.[0];
63
63
  const flattenedContacts = vendorInResponse?.contacts ?? [];
64
64
  const flattenedAddresses = (0, commonVendorViewHelper_1.getFlattenedAddress)(response.data?.vendors ?? []);
65
65
  const flattenedBankAccounts = vendorInResponse?.bank_accounts ?? [];
@@ -91,7 +91,7 @@ const fetchBillDetailEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, ope
91
91
  ...response.data.bank_accounts,
92
92
  ]),
93
93
  (0, paymentInstrumentReducer_1.updatePaymentInstruments)(flattenedPaymentInstruments),
94
- (0, vendorReducer_1.updateVendors)(response.data.vendors),
94
+ (0, vendorReducer_1.updateVendors)(response.data.vendors ?? []),
95
95
  // end: save all vendor related entities
96
96
  ];
97
97
  if (vendorInResponse == null &&
@@ -100,15 +100,15 @@ const fetchBillDetailEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, ope
100
100
  fetchActions.push((0, vendorListReducer_1.fetchVendorsList)({
101
101
  searchString: response.data?.transaction.candidate_vendor_name,
102
102
  }));
103
- fetchActions.push((0, billDetailViewReducer_1.waitForVendorByNameThenUpdateBillDetail)(billId, response.data, response.data.vendors[0]?.vendor_id));
103
+ fetchActions.push((0, billDetailViewReducer_1.waitForVendorByNameThenUpdateBillDetail)(billId, response.data, undefined));
104
104
  }
105
105
  else {
106
106
  fetchActions.push((0, billDetailViewReducer_1.updateBillDetail)({ billId, billDetail: response.data }));
107
- fetchActions.push((0, billDetailViewReducer_1.updateBillDetailFetchState)(transcationId, 'Completed', undefined, response.data.vendors[0]?.vendor_id));
107
+ fetchActions.push((0, billDetailViewReducer_1.updateBillDetailFetchState)(transcationId, 'Completed', undefined, vendorInResponse?.vendor_id));
108
108
  const transactionInResponse = response.data?.transaction;
109
109
  if (transactionInResponse != null &&
110
110
  transactionInResponse.total_amount != null &&
111
- Boolean(vendorInResponse) === true) {
111
+ vendorInResponse != null) {
112
112
  fetchActions.push((0, billPayReviewReducer_1.fetchDuplicateBill)(vendorInResponse.vendor_name, vendorInResponse.vendor_id, transactionInResponse.total_amount, transactionInResponse.recipient_total_amount, transactionInResponse.document_id, billId));
113
113
  }
114
114
  const billHasPaymentError = [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zeniai/client-epic-state",
3
- "version": "5.0.11",
3
+ "version": "5.0.12-beta0ND",
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
  "module": "lib/esm/index.js",