@zeniai/client-epic-state 4.13.49 → 4.13.51

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.
@@ -44,7 +44,7 @@ const issueChargeCardEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, ope
44
44
  return zeniAPI
45
45
  .postAndGetJSON(`${zeniAPI.apiEndPoints.cardMicroServiceBaseUrl}/1.0/cards`, { cards: payload })
46
46
  .pipe((0, operators_1.mergeMap)((response) => {
47
- var _a, _b;
47
+ var _a, _b, _c;
48
48
  if ((0, responsePayload_1.isSuccessStatus)(response) && response.data != null) {
49
49
  const actions = [];
50
50
  actions.push((0, chargeCardReducer_1.updateChargeCards)(response.data.cards), (0, userReducer_1.updateAllUsers)({ users: response.data.users }), (0, userRoleReducer_1.updateUserRoles)(response.data.user_roles), (0, chargeCardListReducer_1.updateChargeCardList)({
@@ -52,11 +52,12 @@ const issueChargeCardEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, ope
52
52
  keepExistingListItems: true,
53
53
  }), (0, addressReducer_1.updateAddresses)(response.data.addresses), (0, issueChargeCardReducer_1.updateCardCount)((_b = (_a = response.data) === null || _a === void 0 ? void 0 : _a.cards_count_by_user_id) !== null && _b !== void 0 ? _b : []), (0, issueChargeCardReducer_1.issueChargeCardSuccessOrFailure)({ fetchState: 'Completed' }));
54
54
  const cardHolderIds = response.data.cards.map((card) => card.holder_user_id);
55
- const names = response.data.users
55
+ const namesList = response.data.users
56
56
  .filter((user) => cardHolderIds.includes(user.user_id))
57
57
  .map((user) => { var _a, _b, _c; return (_b = (_a = user.first_name) === null || _a === void 0 ? void 0 : _a.trim()) !== null && _b !== void 0 ? _b : (_c = user.last_name) === null || _c === void 0 ? void 0 : _c.trim(); })
58
- .join(', ');
59
- if (response.data.cards.length === 1) {
58
+ .filter((name) => name != null);
59
+ if (response.data.cards.length > 0 && namesList.length === 1) {
60
+ const cardText = response.data.cards.length > 1 ? 'cards' : 'card';
60
61
  actions.push((0, snackbarReducer_1.openSnackbar)({
61
62
  messageSection: 'issue_charge_card',
62
63
  messageText: 'success',
@@ -64,7 +65,11 @@ const issueChargeCardEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, ope
64
65
  variables: [
65
66
  {
66
67
  variableName: '_user-name_',
67
- variableValue: names,
68
+ variableValue: (_c = namesList[0]) !== null && _c !== void 0 ? _c : '',
69
+ },
70
+ {
71
+ variableName: '_card_',
72
+ variableValue: cardText,
68
73
  },
69
74
  ],
70
75
  }));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zeniai/client-epic-state",
3
- "version": "4.13.49",
3
+ "version": "4.13.51",
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",