@tap-payments/auth-jsconnect 2.1.76-test → 2.1.77-test

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.
@@ -81,7 +81,7 @@ export interface IndividualPersonalInfoFormValues {
81
81
  name: string;
82
82
  email: string;
83
83
  mobile: string | null;
84
- countryCode: CountryCode | undefined;
84
+ countryCode: CountryCode;
85
85
  gender: string | null;
86
86
  nid: string;
87
87
  issuedCountry: CountryCode | undefined;
@@ -70,7 +70,7 @@ import { createAsyncThunk, createSlice } from '@reduxjs/toolkit';
70
70
  import API from '../../../api';
71
71
  import { FlowsTypes, IndividualGender, IndividualType, FieldType } from '../../../@types';
72
72
  import { handleNextScreenStep, handleSetCountryByIso2 } from '../../../app/settings';
73
- import { IDENTIFICATION_TYPE, INDIVIDUAl_STEP_NAMES } from '../../../constants';
73
+ import { defaultCountry, IDENTIFICATION_TYPE, INDIVIDUAl_STEP_NAMES } from '../../../constants';
74
74
  import { convertNumbers2English, dateFormat, findCountryByIddPrefix, findCountryByIso2, getEighteenYearsAgo, getIndividualName, getUserName, sleep } from '../../../utils';
75
75
  export var verifyLeadToken = createAsyncThunk('individualVerifyLeadToken', function (_a, thunkApi) {
76
76
  var token = _a.token, isInternally = _a.isInternally;
@@ -281,7 +281,7 @@ export var getCityList = createAsyncThunk('individual/getCityList', function (co
281
281
  });
282
282
  }); });
283
283
  export var retrieveIndividualInfo = createAsyncThunk('individual/retrieveIndividualInfo', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
284
- var id, type, countryCode, settings, data;
284
+ var id, type, countryCode, settings, data, individualData;
285
285
  return __generator(this, function (_a) {
286
286
  switch (_a.label) {
287
287
  case 0:
@@ -290,7 +290,12 @@ export var retrieveIndividualInfo = createAsyncThunk('individual/retrieveIndivid
290
290
  return [4, API.individualService.retrieveIndividual(id, type)];
291
291
  case 1:
292
292
  data = _a.sent();
293
- return [2, { data: __assign(__assign({}, ((data === null || data === void 0 ? void 0 : data.user) || {})), { type: type }), countryCode: countryCode, countries: settings.data.countries }];
293
+ individualData = data === null || data === void 0 ? void 0 : data.user;
294
+ if (type === IndividualType.SHARE_HOLDER)
295
+ individualData = data === null || data === void 0 ? void 0 : data.shareholder;
296
+ else if (type === IndividualType.BOARD_MEMBER)
297
+ individualData = data === null || data === void 0 ? void 0 : data.board_member;
298
+ return [2, { data: __assign(__assign({}, (individualData || {})), { type: type }), countryCode: countryCode, countries: settings.data.countries }];
294
299
  }
295
300
  });
296
301
  }); });
@@ -590,7 +595,7 @@ var initialState = {
590
595
  name: '',
591
596
  email: '',
592
597
  mobile: '',
593
- countryCode: undefined,
598
+ countryCode: defaultCountry,
594
599
  gender: IndividualGender.MALE,
595
600
  nid: '',
596
601
  issuedCountry: undefined,
@@ -739,7 +744,7 @@ export var individualSlice = createSlice({
739
744
  if ((_a = contact === null || contact === void 0 ? void 0 : contact.phone) === null || _a === void 0 ? void 0 : _a.number)
740
745
  state.data.individualPersonalData.mobile = (_b = contact === null || contact === void 0 ? void 0 : contact.phone) === null || _b === void 0 ? void 0 : _b.number;
741
746
  if ((_c = contact === null || contact === void 0 ? void 0 : contact.phone) === null || _c === void 0 ? void 0 : _c.country_code) {
742
- state.data.individualPersonalData.countryCode = findCountryByIddPrefix(countries, (_d = contact === null || contact === void 0 ? void 0 : contact.phone) === null || _d === void 0 ? void 0 : _d.country_code);
747
+ state.data.individualPersonalData.countryCode = findCountryByIddPrefix(countries, (_d = contact === null || contact === void 0 ? void 0 : contact.phone) === null || _d === void 0 ? void 0 : _d.country_code) || defaultCountry;
743
748
  }
744
749
  if (gender)
745
750
  state.data.individualPersonalData.gender = gender.toLowerCase();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tap-payments/auth-jsconnect",
3
- "version": "2.1.76-test",
3
+ "version": "2.1.77-test",
4
4
  "description": "connect library, auth",
5
5
  "private": false,
6
6
  "main": "build/index.js",