@tap-payments/auth-jsconnect 2.9.21-sandbox → 2.9.22-sandbox
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.
|
@@ -55,9 +55,10 @@ import { sendCustomEventToGTM, sleep } from '../../../utils';
|
|
|
55
55
|
export var verifyTokenApi = createAsyncThunk('kyc/verifyTokenApi', function (_a, thunkApi) {
|
|
56
56
|
var token = _a.token;
|
|
57
57
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
58
|
-
var payload, data, _b, config, country_code, segment_id, boardId,
|
|
59
|
-
|
|
60
|
-
|
|
58
|
+
var payload, data, _b, config, country_code, segment_id, boardId, boardInfoId, publicKey, info, isCompleted, nextScreen, userList, userPayload, users;
|
|
59
|
+
var _c;
|
|
60
|
+
return __generator(this, function (_d) {
|
|
61
|
+
switch (_d.label) {
|
|
61
62
|
case 0:
|
|
62
63
|
payload = {
|
|
63
64
|
service_name: 'tap_email',
|
|
@@ -68,15 +69,20 @@ export var verifyTokenApi = createAsyncThunk('kyc/verifyTokenApi', function (_a,
|
|
|
68
69
|
};
|
|
69
70
|
return [4, API.leadService.verifyToken(payload)];
|
|
70
71
|
case 1:
|
|
71
|
-
data =
|
|
72
|
-
_b = data || {}, config = _b.config, country_code = _b.country_code, segment_id = _b.segment_id, boardId = _b.id,
|
|
72
|
+
data = _d.sent();
|
|
73
|
+
_b = data || {}, config = _b.config, country_code = _b.country_code, segment_id = _b.segment_id, boardId = _b.id, boardInfoId = _b.board_info_id;
|
|
73
74
|
publicKey = config === null || config === void 0 ? void 0 : config.public_key;
|
|
74
|
-
|
|
75
|
+
return [4, API.boardService.retrieveBoardInfo({ id: boardId, infoId: boardInfoId })];
|
|
76
|
+
case 2:
|
|
77
|
+
info = (_d.sent()).info;
|
|
78
|
+
isCompleted = ((_c = info === null || info === void 0 ? void 0 : info.find(function (flow) { return flow.name === 'kyc'; })) === null || _c === void 0 ? void 0 : _c.status) === 'completed';
|
|
79
|
+
nextScreen = isCompleted ? CONNECT_FLOWS.kyc.alreadySubmitted : CONNECT_FLOWS.kyc.terms;
|
|
75
80
|
userList = [];
|
|
76
81
|
if (country_code)
|
|
77
82
|
thunkApi.dispatch(handleSetCountryByIso2(country_code));
|
|
78
83
|
if (publicKey)
|
|
79
84
|
thunkApi.dispatch(handlePublicKey(publicKey));
|
|
85
|
+
if (!!isCompleted) return [3, 4];
|
|
80
86
|
userPayload = {
|
|
81
87
|
page: 1,
|
|
82
88
|
limit: 25,
|
|
@@ -84,15 +90,16 @@ export var verifyTokenApi = createAsyncThunk('kyc/verifyTokenApi', function (_a,
|
|
|
84
90
|
segment_ids: [segment_id]
|
|
85
91
|
};
|
|
86
92
|
return [4, API.userService.getUserListUsingSegmentId(userPayload)];
|
|
87
|
-
case
|
|
88
|
-
users = (
|
|
93
|
+
case 3:
|
|
94
|
+
users = (_d.sent()).users;
|
|
89
95
|
userList = users || [];
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
+
_d.label = 4;
|
|
97
|
+
case 4: return [2, {
|
|
98
|
+
data: __assign(__assign({}, data), { boardId: boardId }),
|
|
99
|
+
userList: userList,
|
|
100
|
+
token: token,
|
|
101
|
+
nextScreen: nextScreen
|
|
102
|
+
}];
|
|
96
103
|
}
|
|
97
104
|
});
|
|
98
105
|
});
|