@zeniai/client-epic-state 4.16.61 → 4.16.62

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.
@@ -29,7 +29,19 @@ exports.getExpenseAutomationReconciliationView = (0, toolkit_1.createSelector)((
29
29
  ? reconciliationViewState.accountReconciliationRecordsBySelectedPeriod[(0, timePeriod_1.toMonthYearPeriodId)(selectedPeriod)]
30
30
  : undefined;
31
31
  const bankAccounts = (_b = (_a = (0, accountSelector_1.getAccountsByType)(accountState, ['bank'])) === null || _a === void 0 ? void 0 : _a.bank) !== null && _b !== void 0 ? _b : [];
32
+ const uniqueBankAccounts = bankAccounts.reduce((acc, item) => {
33
+ if (!acc.some((existing) => existing.accountId === item.accountId)) {
34
+ acc.push(item);
35
+ }
36
+ return acc;
37
+ }, []);
32
38
  const creditCards = (_d = (_c = (0, accountSelector_1.getAccountsByType)(accountState, ['credit_card'])) === null || _c === void 0 ? void 0 : _c.credit_card) !== null && _d !== void 0 ? _d : [];
39
+ const uniqueCreditCards = creditCards.reduce((acc, item) => {
40
+ if (!acc.some((existing) => existing.accountId === item.accountId)) {
41
+ acc.push(item);
42
+ }
43
+ return acc;
44
+ }, []);
33
45
  if (accountReconForMonthYearPeriod == null) {
34
46
  return {
35
47
  bankAccounts: [],
@@ -243,8 +255,8 @@ exports.getExpenseAutomationReconciliationView = (0, toolkit_1.createSelector)((
243
255
  })
244
256
  .filter((entry) => entry !== null));
245
257
  return {
246
- bankAccounts,
247
- creditCards,
258
+ bankAccounts: uniqueBankAccounts,
259
+ creditCards: uniqueCreditCards,
248
260
  accountReconciliationsByAccountID: reconList,
249
261
  fetchStatus: {
250
262
  fetchState: reconciliationViewState.fetchState,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zeniai/client-epic-state",
3
- "version": "4.16.61",
3
+ "version": "4.16.62",
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",