@zeniai/client-epic-state 4.12.64 → 4.12.65

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.
@@ -27,15 +27,20 @@ const issueChargeCardEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, ope
27
27
  return zeniAPI
28
28
  .postAndGetJSON(`${zeniAPI.apiEndPoints.cardMicroServiceBaseUrl}/1.0/cards`, { cards: payload })
29
29
  .pipe((0, operators_1.mergeMap)((response) => {
30
+ var _a, _b, _c;
30
31
  if ((0, responsePayload_1.isSuccessStatus)(response) && response.data != null) {
31
32
  const actions = [];
32
33
  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)({
33
34
  chargeCardListPayload: response.data,
34
35
  keepExistingListItems: true,
35
36
  }), (0, addressReducer_1.updateAddresses)(response.data.addresses), (0, chargeCardListReducer_1.issueChargeCardSuccessOrFailure)({ fetchState: 'Completed' }));
36
- const names = response.data.users
37
- .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(); })
38
- .join(', ');
37
+ //removing the last user, because it belongs to created_by user
38
+ const names = response.data.users.length === 1
39
+ ? (_b = (_a = response.data.users[0].first_name) === null || _a === void 0 ? void 0 : _a.trim()) !== null && _b !== void 0 ? _b : (_c = response.data.users[0].last_name) === null || _c === void 0 ? void 0 : _c.trim()
40
+ : response.data.users
41
+ .slice(0, -1)
42
+ .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(); })
43
+ .join(', ');
39
44
  actions.push((0, snackbarReducer_1.openSnackbar)({
40
45
  messageSection: 'issue_charge_card',
41
46
  messageText: 'success',
@@ -43,7 +48,7 @@ const issueChargeCardEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, ope
43
48
  variables: [
44
49
  {
45
50
  variableName: '_user-name_',
46
- variableValue: names,
51
+ variableValue: names !== null && names !== void 0 ? names : '',
47
52
  },
48
53
  ],
49
54
  }));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zeniai/client-epic-state",
3
- "version": "4.12.64",
3
+ "version": "4.12.65",
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",