@tap-payments/auth-jsconnect 2.4.26-test → 2.4.27-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.
|
@@ -115,6 +115,7 @@ export declare const checkEmailAvailability: import("@reduxjs/toolkit").AsyncThu
|
|
|
115
115
|
export declare const updateBoardSuccess: import("@reduxjs/toolkit").AsyncThunk<{
|
|
116
116
|
response: any;
|
|
117
117
|
formData: void;
|
|
118
|
+
individualData: any;
|
|
118
119
|
} | undefined, void, {}>;
|
|
119
120
|
declare type VerifyData = {
|
|
120
121
|
token: string;
|
|
@@ -346,7 +346,7 @@ export var retrieveIndividualInfo = createAsyncThunk('individual/retrieveIndivid
|
|
|
346
346
|
else if (type === IndividualType.CUSTOMER)
|
|
347
347
|
individualData = data === null || data === void 0 ? void 0 : data.customer;
|
|
348
348
|
return [2, {
|
|
349
|
-
data: __assign(__assign({}, (individualData || {})), { objects: [type], individual_data_state: individualData === null || individualData === void 0 ? void 0 : individualData.data_state }),
|
|
349
|
+
data: __assign(__assign({}, (individualData || {})), { objects: [type], individual_data_state: individualData === null || individualData === void 0 ? void 0 : individualData.data_state, object: type }),
|
|
350
350
|
countryCode: countryCode,
|
|
351
351
|
countries: settings.data.countries
|
|
352
352
|
}];
|
|
@@ -760,13 +760,13 @@ export var checkEmailAvailability = createAsyncThunk('checkEmailAvailability', f
|
|
|
760
760
|
});
|
|
761
761
|
});
|
|
762
762
|
export var updateBoardSuccess = createAsyncThunk('individualUpdateBoardSuccess', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
763
|
-
var _a, settings, individual, _b, id, infoId, payload, data, boardInfoStatus;
|
|
764
|
-
var
|
|
765
|
-
return __generator(this, function (
|
|
766
|
-
switch (
|
|
763
|
+
var _a, settings, individual, _b, id, infoId, primaryUser, payload, data, boardInfoStatus, individualDataRes, _c, is_authorized, userId, type;
|
|
764
|
+
var _d, _e, _f, _g;
|
|
765
|
+
return __generator(this, function (_h) {
|
|
766
|
+
switch (_h.label) {
|
|
767
767
|
case 0:
|
|
768
768
|
_a = thunkApi.getState(), settings = _a.settings, individual = _a.individual;
|
|
769
|
-
_b = individual.data.verify.responseBody || {}, id = _b.board_id, infoId = _b.board_info_id;
|
|
769
|
+
_b = individual.data.verify.responseBody || {}, id = _b.board_id, infoId = _b.board_info_id, primaryUser = _b.primaryUser;
|
|
770
770
|
if (!id)
|
|
771
771
|
return [2];
|
|
772
772
|
payload = {
|
|
@@ -776,17 +776,27 @@ export var updateBoardSuccess = createAsyncThunk('individualUpdateBoardSuccess',
|
|
|
776
776
|
};
|
|
777
777
|
return [4, API.boardService.updateBoardInfo(__assign({ id: id, infoId: infoId }, payload))];
|
|
778
778
|
case 1:
|
|
779
|
-
data =
|
|
779
|
+
data = _h.sent();
|
|
780
780
|
return [4, API.boardService.retrieveBoardInfoStatus(id)];
|
|
781
781
|
case 2:
|
|
782
|
-
boardInfoStatus =
|
|
782
|
+
boardInfoStatus = _h.sent();
|
|
783
783
|
return [4, thunkApi.dispatch(retrieveBoardDetails(id))];
|
|
784
784
|
case 3:
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
785
|
+
_h.sent();
|
|
786
|
+
individualDataRes = undefined;
|
|
787
|
+
_c = primaryUser || {}, is_authorized = _c.is_authorized, userId = _c.id, type = _c.object;
|
|
788
|
+
if (!!is_authorized) return [3, 5];
|
|
789
|
+
return [4, thunkApi
|
|
790
|
+
.dispatch(retrieveIndividualInfo({ id: userId, type: type, countryCode: settings.data.businessCountry.iso2 }))
|
|
791
|
+
.unwrap()];
|
|
792
|
+
case 4:
|
|
793
|
+
individualDataRes = _h.sent();
|
|
794
|
+
_h.label = 5;
|
|
795
|
+
case 5:
|
|
796
|
+
(_e = (_d = settings.data.appConfig).onStepCompleted) === null || _e === void 0 ? void 0 : _e.call(_d, settings.data.activeScreen.name, {});
|
|
797
|
+
(_g = (_f = settings.data.appConfig).onFlowCompleted) === null || _g === void 0 ? void 0 : _g.call(_f, { data: data });
|
|
788
798
|
thunkApi.dispatch(handleNextScreenStep());
|
|
789
|
-
return [2, { response: __assign(__assign({}, data), { flows: (boardInfoStatus === null || boardInfoStatus === void 0 ? void 0 : boardInfoStatus.info) || [] }), formData: params }];
|
|
799
|
+
return [2, { response: __assign(__assign({}, data), { flows: (boardInfoStatus === null || boardInfoStatus === void 0 ? void 0 : boardInfoStatus.info) || [] }), formData: params, individualData: individualDataRes === null || individualDataRes === void 0 ? void 0 : individualDataRes.data }];
|
|
790
800
|
}
|
|
791
801
|
});
|
|
792
802
|
}); });
|
|
@@ -1033,7 +1043,7 @@ export var individualSlice = createSlice({
|
|
|
1033
1043
|
state.error = null;
|
|
1034
1044
|
var _e = action.payload, data = _e.data, countries = _e.countries;
|
|
1035
1045
|
var user = (state.data.verify.responseBody || {}).user;
|
|
1036
|
-
state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), { user: __assign(__assign({}, data), { is_authorized: data.is_authorized !== undefined ? data.is_authorized : user === null || user === void 0 ? void 0 : user.is_authorized }) });
|
|
1046
|
+
state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), { primaryUser: data, user: __assign(__assign({}, data), { is_authorized: data.is_authorized !== undefined ? data.is_authorized : user === null || user === void 0 ? void 0 : user.is_authorized }) });
|
|
1037
1047
|
var _f = data || {}, source_income = _f.source_income, monthly_income = _f.monthly_income, occupation = _f.occupation, is_relative_PEP = _f.is_relative_PEP, is_influencer = _f.is_influencer, birth = _f.birth, contact = _f.contact, identification = _f.identification, nationality = _f.nationality, gender = _f.gender, shares = _f.shares;
|
|
1038
1048
|
var _g = state.data.individualData.responseBody || {}, sourceIncomeList = _g.sourceIncomeList, monthlyIncomeList = _g.monthlyIncomeList, occupationList = _g.occupationList;
|
|
1039
1049
|
var cityList = (state.data.verify.responseBody || {}).cityList;
|
|
@@ -1262,14 +1272,15 @@ export var individualSlice = createSlice({
|
|
|
1262
1272
|
var _a;
|
|
1263
1273
|
state.loading = false;
|
|
1264
1274
|
state.error = null;
|
|
1265
|
-
var
|
|
1275
|
+
var _b = action.payload || {}, response = _b.response, individualData = _b.individualData;
|
|
1266
1276
|
var description = (((_a = response === null || response === void 0 ? void 0 : response.errors) === null || _a === void 0 ? void 0 : _a[0]) || {}).description;
|
|
1267
1277
|
if (description) {
|
|
1268
1278
|
state.error = description;
|
|
1269
1279
|
return;
|
|
1270
1280
|
}
|
|
1271
1281
|
var flows = response.flows;
|
|
1272
|
-
|
|
1282
|
+
var individuals = (state.data.verify.responseBody || {}).individuals;
|
|
1283
|
+
state.data.verify.responseBody = __assign(__assign(__assign({}, state.data.verify.responseBody), { flows: flows }), (individualData && { individuals: __assign(__assign({}, individuals), { data_state: individualData === null || individualData === void 0 ? void 0 : individualData.data_state }) }));
|
|
1273
1284
|
})
|
|
1274
1285
|
.addCase(updateBoardSuccess.pending, function (state) {
|
|
1275
1286
|
state.loading = true;
|