@tap-payments/auth-jsconnect 2.8.55-beta → 2.8.55-development
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.
- package/build/@types/app.d.ts +1 -0
- package/build/@types/form.d.ts +1 -0
- package/build/@types/redux.d.ts +1 -0
- package/build/api/entity.d.ts +2 -2
- package/build/api/entity.js +12 -4
- package/build/api/index.d.ts +2 -2
- package/build/constants/api.d.ts +0 -1
- package/build/constants/api.js +0 -2
- package/build/constants/app.d.ts +0 -2
- package/build/constants/app.js +0 -2
- package/build/features/app/bank/bankStore.d.ts +13 -18
- package/build/features/app/bank/bankStore.js +184 -165
- package/build/features/app/board/boardStore.js +52 -30
- package/build/features/app/brand/brandStore.d.ts +16 -33
- package/build/features/app/brand/brandStore.js +239 -242
- package/build/features/app/business/businessStore.d.ts +0 -5
- package/build/features/app/business/businessStore.js +76 -87
- package/build/features/app/connectExpress/connectExpressStore.d.ts +15 -6
- package/build/features/app/connectExpress/connectExpressStore.js +110 -52
- package/build/features/app/entity/entityStore.d.ts +20 -36
- package/build/features/app/entity/entityStore.js +196 -246
- package/build/features/app/individual/individualStore.d.ts +22 -38
- package/build/features/app/individual/individualStore.js +263 -266
- package/build/features/app/password/passwordStore.d.ts +40 -23
- package/build/features/app/password/passwordStore.js +226 -233
- package/build/features/app/tax/taxStore.d.ts +13 -7
- package/build/features/app/tax/taxStore.js +168 -147
- package/build/features/auth/screens/AuthSwitch/AuthSwitch.js +13 -1
- package/build/features/auth/screens/BusinessCountry/BusinessCountry.js +7 -1
- package/build/features/bank/Bank.d.ts +1 -0
- package/build/features/bank/Bank.js +7 -4
- package/build/features/bank/screens/BankDetails/BankDetails.js +18 -5
- package/build/features/bank/screens/OperatorError/OperatorError.d.ts +5 -0
- package/build/features/bank/screens/OperatorError/OperatorError.js +9 -0
- package/build/features/bank/screens/OperatorError/index.d.ts +3 -0
- package/build/features/bank/screens/OperatorError/index.js +2 -0
- package/build/features/bank/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -2
- package/build/features/bank/screens/Verify/Verify.js +5 -5
- package/build/features/board/Board.js +8 -4
- package/build/features/board/screens/OperatorError/OperatorError.d.ts +5 -0
- package/build/features/board/screens/OperatorError/OperatorError.js +9 -0
- package/build/features/board/screens/OperatorError/index.d.ts +3 -0
- package/build/features/board/screens/OperatorError/index.js +2 -0
- package/build/features/board/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +3 -4
- package/build/features/brand/Brand.d.ts +1 -0
- package/build/features/brand/Brand.js +7 -4
- package/build/features/brand/screens/BrandActivities/BrandActivities.js +49 -12
- package/build/features/brand/screens/BrandActivities/ExpectedSalesRange.js +6 -3
- package/build/features/brand/screens/BrandActivities/RefundPolicy.js +1 -1
- package/build/features/brand/screens/BrandActivities/TAC.js +1 -1
- package/build/features/brand/screens/BrandActivities/TransactionPolicy.js +1 -1
- package/build/features/brand/screens/BrandInfo/BrandInfo.js +23 -5
- package/build/features/brand/screens/BrandSegmentInfo/BrandSegmentInfo.js +23 -7
- package/build/features/brand/screens/OperatorError/OperatorError.d.ts +5 -0
- package/build/features/brand/screens/OperatorError/OperatorError.js +9 -0
- package/build/features/brand/screens/OperatorError/index.d.ts +3 -0
- package/build/features/brand/screens/OperatorError/index.js +2 -0
- package/build/features/brand/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -2
- package/build/features/brand/screens/Verify/Verify.js +1 -1
- package/build/features/business/Business.js +9 -4
- package/build/features/business/screens/Activities/Activities.js +12 -3
- package/build/features/business/screens/BusinessType/BusinessType.js +10 -2
- package/build/features/business/screens/CivilID/CivilID.js +1 -1
- package/build/features/business/screens/Customers/Customers.js +12 -3
- package/build/features/business/screens/Customers/ExpectedSalesRange.js +6 -3
- package/build/features/business/screens/IDBOD/IDBOD.js +10 -2
- package/build/features/business/screens/OTP/OTP.js +1 -1
- package/build/features/business/screens/OperatorError/OperatorError.d.ts +5 -0
- package/build/features/business/screens/OperatorError/OperatorError.js +9 -0
- package/build/features/business/screens/OperatorError/index.d.ts +3 -0
- package/build/features/business/screens/OperatorError/index.js +2 -0
- package/build/features/business/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +14 -3
- package/build/features/business/screens/Verify/Verify.js +13 -3
- package/build/features/connect/Connect.js +3 -2
- package/build/features/connect/screens/BrandSegment/BrandSegment.js +1 -1
- package/build/features/connect/screens/BusinessCountry/BusinessCountry.js +9 -2
- package/build/features/connect/screens/CivilID/CivilID.js +1 -1
- package/build/features/connect/screens/Individual/Email.js +3 -1
- package/build/features/connect/screens/Individual/Individual.js +1 -1
- package/build/features/connect/screens/Merchant/BrandList.js +3 -3
- package/build/features/connect/screens/Merchant/Merchant.js +1 -1
- package/build/features/connect/screens/Merchant/SalesChannels.js +1 -1
- package/build/features/connect/screens/Mobile/Mobile.js +11 -8
- package/build/features/connect/screens/NID/NID.js +1 -1
- package/build/features/connect/screens/OperatorError/OperatorError.js +1 -1
- package/build/features/connectExpress/ConnectExpress.js +2 -1
- package/build/features/connectExpress/screens/AuthenticationList/AuthenticationList.js +5 -2
- package/build/features/connectExpress/screens/AuthenticationList/EntityLicenseType.d.ts +9 -0
- package/build/features/connectExpress/screens/AuthenticationList/EntityLicenseType.js +90 -0
- package/build/features/connectExpress/screens/AuthenticationList/EntityList.js +6 -1
- package/build/features/connectExpress/screens/AuthenticationList/validation.d.ts +3 -0
- package/build/features/connectExpress/screens/AuthenticationList/validation.js +10 -0
- package/build/features/connectExpress/screens/BusinessCountry/BusinessCountry.js +7 -1
- package/build/features/connectExpress/screens/CivilID/CivilID.js +1 -1
- package/build/features/connectExpress/screens/CivilIDMissed/CivilID.js +1 -1
- package/build/features/connectExpress/screens/CollectBusinessInfo/CollectBusinessInfo.js +1 -1
- package/build/features/connectExpress/screens/CollectIndividualInfo/CollectIndividualInfo.js +1 -1
- package/build/features/connectExpress/screens/CollectIndividualInfo/Email.js +3 -1
- package/build/features/connectExpress/screens/CreateAccountLoader/CreateAccountLoader.js +14 -24
- package/build/features/connectExpress/screens/Mobile/Mobile.js +9 -2
- package/build/features/connectExpress/screens/NID/NID.js +1 -1
- package/build/features/connectExpress/screens/NIDMissed/NID.js +1 -1
- package/build/features/connectExpress/screens/OperatorError/OperatorError.d.ts +5 -0
- package/build/features/connectExpress/screens/OperatorError/OperatorError.js +9 -0
- package/build/features/connectExpress/screens/OperatorError/index.d.ts +3 -0
- package/build/features/connectExpress/screens/OperatorError/index.js +2 -0
- package/build/features/connectExpress/screens/PrepareDataLoading/PrepareDataLoading.d.ts +5 -0
- package/build/features/connectExpress/screens/PrepareDataLoading/PrepareDataLoading.js +34 -0
- package/build/features/connectExpress/screens/PrepareDataLoading/index.d.ts +2 -0
- package/build/features/connectExpress/screens/PrepareDataLoading/index.js +2 -0
- package/build/features/connectExpress/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -2
- package/build/features/entity/Entity.d.ts +1 -0
- package/build/features/entity/Entity.js +7 -4
- package/build/features/entity/screens/EntityCapital/CapitalPaid.js +8 -4
- package/build/features/entity/screens/EntityCapital/CapitalShareValue.js +8 -4
- package/build/features/entity/screens/EntityCapital/EntityCapital.js +34 -10
- package/build/features/entity/screens/EntityName/EntityName.js +32 -15
- package/build/features/entity/screens/OperatorError/OperatorError.d.ts +5 -0
- package/build/features/entity/screens/OperatorError/OperatorError.js +9 -0
- package/build/features/entity/screens/OperatorError/index.d.ts +3 -0
- package/build/features/entity/screens/OperatorError/index.js +2 -0
- package/build/features/entity/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -2
- package/build/features/entity/screens/Verify/Verify.js +1 -1
- package/build/features/featuresScreens.js +67 -7
- package/build/features/individual/Individual.d.ts +1 -0
- package/build/features/individual/Individual.js +7 -4
- package/build/features/individual/screens/AdditionalIndividualInfo/AdditionalIndividualInfo.js +54 -14
- package/build/features/individual/screens/AdditionalIndividualInfo/IsAuthorizedSwitch.d.ts +14 -0
- package/build/features/individual/screens/AdditionalIndividualInfo/IsAuthorizedSwitch.js +76 -0
- package/build/features/individual/screens/AdditionalIndividualInfo/MonthlyIncome.js +5 -2
- package/build/features/individual/screens/AdditionalIndividualInfo/ShareValue.js +8 -3
- package/build/features/individual/screens/AdditionalIndividualInfo/validation.d.ts +4 -1
- package/build/features/individual/screens/AdditionalIndividualInfo/validation.js +3 -2
- package/build/features/individual/screens/IndividualList/Email.js +3 -2
- package/build/features/individual/screens/IndividualList/IndividualList.js +18 -5
- package/build/features/individual/screens/IndividualList/UserList.js +13 -9
- package/build/features/individual/screens/IndividualPersonalInfo/Email.js +4 -2
- package/build/features/individual/screens/IndividualPersonalInfo/IndividualPersonalInfo.js +76 -20
- package/build/features/individual/screens/IndividualPhoneInfo/PhoneInfo.js +1 -1
- package/build/features/individual/screens/OperatorError/OperatorError.d.ts +5 -0
- package/build/features/individual/screens/OperatorError/OperatorError.js +9 -0
- package/build/features/individual/screens/OperatorError/index.d.ts +3 -0
- package/build/features/individual/screens/OperatorError/index.js +2 -0
- package/build/features/individual/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -2
- package/build/features/individual/screens/Verify/Verify.js +1 -1
- package/build/features/password/Password.d.ts +1 -0
- package/build/features/password/Password.js +75 -28
- package/build/features/password/screens/CreatePassword/CreatePassword.js +8 -4
- package/build/features/password/screens/OTP/OTP.js +1 -1
- package/build/features/password/screens/OperatorError/OperatorError.d.ts +5 -0
- package/build/features/password/screens/OperatorError/OperatorError.js +9 -0
- package/build/features/password/screens/OperatorError/index.d.ts +3 -0
- package/build/features/password/screens/OperatorError/index.js +2 -0
- package/build/features/password/screens/PrepareDataLoading/PrepareDataLoading.d.ts +4 -0
- package/build/features/password/screens/PrepareDataLoading/PrepareDataLoading.js +10 -0
- package/build/features/password/screens/PrepareDataLoading/index.d.ts +2 -0
- package/build/features/password/screens/PrepareDataLoading/index.js +2 -0
- package/build/features/password/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -2
- package/build/features/password/screens/Verify/Verify.js +5 -5
- package/build/features/shared/Button/FlowsButtons.js +13 -3
- package/build/features/shared/Containers/FeatureContainer.d.ts +1 -0
- package/build/features/shared/Containers/FeatureContainer.js +3 -3
- package/build/features/shared/SuccessFlowButtons/SuccessFlowButtons.d.ts +5 -1
- package/build/features/shared/SuccessFlowButtons/SuccessFlowButtons.js +3 -3
- package/build/features/signIn/SignIn.js +12 -3
- package/build/features/signIn/screens/OperatorError/OperatorError.d.ts +5 -0
- package/build/features/signIn/screens/OperatorError/OperatorError.js +9 -0
- package/build/features/signIn/screens/OperatorError/index.d.ts +3 -0
- package/build/features/signIn/screens/OperatorError/index.js +2 -0
- package/build/features/tax/Tax.d.ts +1 -0
- package/build/features/tax/Tax.js +7 -4
- package/build/features/tax/screens/OperatorError/OperatorError.d.ts +5 -0
- package/build/features/tax/screens/OperatorError/OperatorError.js +9 -0
- package/build/features/tax/screens/OperatorError/index.d.ts +3 -0
- package/build/features/tax/screens/OperatorError/index.js +2 -0
- package/build/features/tax/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +2 -2
- package/build/features/tax/screens/TaxDetails/TaxDetails.js +7 -2
- package/build/features/tax/screens/Verify/Verify.js +5 -5
- package/build/hooks/index.d.ts +1 -0
- package/build/hooks/index.js +1 -0
- package/build/hooks/useFormDirtyCheck.d.ts +10 -0
- package/build/hooks/useFormDirtyCheck.js +66 -0
- package/build/hooks/useVerifyToken.d.ts +5 -2
- package/build/hooks/useVerifyToken.js +10 -5
- package/build/utils/common.js +4 -4
- package/build/utils/locale.js +2 -1
- package/build/utils/string.d.ts +5 -2
- package/build/utils/string.js +34 -5
- package/package.json +2 -2
|
@@ -49,79 +49,58 @@ var _a;
|
|
|
49
49
|
import { createAsyncThunk, createSlice } from '@reduxjs/toolkit';
|
|
50
50
|
import API from '../../../api';
|
|
51
51
|
import { FlowsTypes } from '../../../@types';
|
|
52
|
-
import { handleCurrentActiveScreen, handleNextScreenStep, handlePublicKey, handleSetCountryByIso2, onCloseComplete } from '../../../app/settings';
|
|
52
|
+
import { handleCurrentActiveScreen, handleNextScreenStep, handlePrevScreenStep, handlePublicKey, handleSetCountryByIso2, onCloseComplete } from '../../../app/settings';
|
|
53
53
|
import { PASSWORD_OPERATION_TYPE, PASSWORD_STEP_NAMES } from '../../../constants';
|
|
54
|
-
import { retrieveIndividualData } from '../../../utils';
|
|
55
|
-
export var verifyLeadToken = createAsyncThunk('passwordVerifyLeadToken', function (
|
|
56
|
-
var
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
verify_token: token
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
54
|
+
import { retrieveIndividualData, sleep } from '../../../utils';
|
|
55
|
+
export var verifyLeadToken = createAsyncThunk('passwordVerifyLeadToken', function (_a, thunkApi) {
|
|
56
|
+
var token = _a.token, isInternally = _a.isInternally;
|
|
57
|
+
return __awaiter(void 0, void 0, void 0, function () {
|
|
58
|
+
var payload, data, _b, config, board_info_password_status, country_code, board_id, countryIso2, publicKey, data_1;
|
|
59
|
+
var _c, _d;
|
|
60
|
+
return __generator(this, function (_e) {
|
|
61
|
+
switch (_e.label) {
|
|
62
|
+
case 0:
|
|
63
|
+
payload = __assign({ service_name: 'tap_email', verify_token: token }, (isInternally && {
|
|
64
|
+
notification: {
|
|
65
|
+
sms: false
|
|
66
|
+
}
|
|
67
|
+
}));
|
|
68
|
+
return [4, API.leadService.verifyLeadToken(payload)];
|
|
69
|
+
case 1:
|
|
70
|
+
data = (_e.sent()).data;
|
|
71
|
+
if (((_c = data === null || data === void 0 ? void 0 : data.errors) === null || _c === void 0 ? void 0 : _c.length) || (data === null || data === void 0 ? void 0 : data.mw_error))
|
|
72
|
+
throw new Error(data.errors[0].description || (data === null || data === void 0 ? void 0 : data.mw_error));
|
|
73
|
+
if (isInternally)
|
|
74
|
+
data.step_name = PASSWORD_STEP_NAMES.PASSWORD_INFO;
|
|
75
|
+
_b = data || {}, config = _b.config, board_info_password_status = _b.board_info_password_status, country_code = _b.country_code, board_id = _b.board_id;
|
|
76
76
|
countryIso2 = country_code;
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
thunkApi.dispatch(handleSetCountryByIso2(countryIso2));
|
|
103
|
-
}
|
|
104
|
-
info = (boardStatusData || {}).info;
|
|
105
|
-
hasPasswordCompleted = ((_f = info === null || info === void 0 ? void 0 : info.find(function (flow) { return flow.name === 'password'; })) === null || _f === void 0 ? void 0 : _f.status) === 'completed';
|
|
106
|
-
if (data.step_name === PASSWORD_STEP_NAMES.PHONE_AUTH) {
|
|
107
|
-
thunkApi.dispatch(handleCurrentActiveScreen('PASSWORD_VERIFY_STEP'));
|
|
108
|
-
}
|
|
109
|
-
else if (hasPasswordCompleted) {
|
|
110
|
-
thunkApi.dispatch(handleNextScreenStep('PASSWORD_SUCCESS_FOUR_FLOWS_BUTTONS_STEP'));
|
|
111
|
-
}
|
|
112
|
-
else if (data.step_name === PASSWORD_STEP_NAMES.PASSWORD_INFO) {
|
|
113
|
-
thunkApi.dispatch(handleNextScreenStep('PASSWORD_CREATE_PASSWORD_STEP'));
|
|
114
|
-
}
|
|
115
|
-
_j.label = 8;
|
|
116
|
-
case 8: return [2, {
|
|
117
|
-
data: data,
|
|
118
|
-
individualData: individualData,
|
|
119
|
-
boardResponse: __assign(__assign({}, boardData === null || boardData === void 0 ? void 0 : boardData.business), { flows: (boardStatusData === null || boardStatusData === void 0 ? void 0 : boardStatusData.info) || [], user: boardData === null || boardData === void 0 ? void 0 : boardData.user, brand: boardData === null || boardData === void 0 ? void 0 : boardData.brand, bank_account: boardData === null || boardData === void 0 ? void 0 : boardData.bank_account, entity: boardData === null || boardData === void 0 ? void 0 : boardData.entity, merchant: boardData === null || boardData === void 0 ? void 0 : boardData.merchant, individuals: boardData === null || boardData === void 0 ? void 0 : boardData.individuals, name: (_g = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _g === void 0 ? void 0 : _g.names, contact: (_h = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _h === void 0 ? void 0 : _h.contact, business: boardData === null || boardData === void 0 ? void 0 : boardData.business, notification: boardInfoData === null || boardInfoData === void 0 ? void 0 : boardInfoData.notification }),
|
|
120
|
-
token: token
|
|
121
|
-
}];
|
|
122
|
-
}
|
|
77
|
+
if (countryIso2)
|
|
78
|
+
thunkApi.dispatch(handleSetCountryByIso2(countryIso2));
|
|
79
|
+
publicKey = config === null || config === void 0 ? void 0 : config.public_key;
|
|
80
|
+
if (publicKey)
|
|
81
|
+
thunkApi.dispatch(handlePublicKey(publicKey));
|
|
82
|
+
if (!!country_code) return [3, 3];
|
|
83
|
+
return [4, API.boardService.retrieveBoardDetails(board_id)];
|
|
84
|
+
case 2:
|
|
85
|
+
data_1 = _e.sent();
|
|
86
|
+
if ((_d = data_1 === null || data_1 === void 0 ? void 0 : data_1.entity) === null || _d === void 0 ? void 0 : _d.country)
|
|
87
|
+
thunkApi.dispatch(handleSetCountryByIso2(data_1.entity.country));
|
|
88
|
+
_e.label = 3;
|
|
89
|
+
case 3:
|
|
90
|
+
if (data.step_name === PASSWORD_STEP_NAMES.PHONE_AUTH) {
|
|
91
|
+
thunkApi.dispatch(handleCurrentActiveScreen('PASSWORD_VERIFY_STEP'));
|
|
92
|
+
}
|
|
93
|
+
else if (board_info_password_status === 'completed') {
|
|
94
|
+
thunkApi.dispatch(handleNextScreenStep('PASSWORD_SUCCESS_FOUR_FLOWS_BUTTONS_STEP'));
|
|
95
|
+
}
|
|
96
|
+
else if (data.step_name === PASSWORD_STEP_NAMES.PASSWORD_INFO) {
|
|
97
|
+
thunkApi.dispatch(handleNextScreenStep('PASSWORD_CREATE_PASSWORD_STEP'));
|
|
98
|
+
}
|
|
99
|
+
return [2, { data: data, token: token }];
|
|
100
|
+
}
|
|
101
|
+
});
|
|
123
102
|
});
|
|
124
|
-
});
|
|
103
|
+
});
|
|
125
104
|
export var resendOTP = createAsyncThunk('resendOTPPassword', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
126
105
|
var password, payload, data;
|
|
127
106
|
return __generator(this, function (_a) {
|
|
@@ -139,54 +118,74 @@ export var resendOTP = createAsyncThunk('resendOTPPassword', function (params, t
|
|
|
139
118
|
}
|
|
140
119
|
});
|
|
141
120
|
}); });
|
|
142
|
-
export var retrieveBoardDetails = createAsyncThunk('retrievePasswordBoardDetails', function (
|
|
143
|
-
var
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
121
|
+
export var retrieveBoardDetails = createAsyncThunk('retrievePasswordBoardDetails', function (_a) {
|
|
122
|
+
var boardId = _a.boardId, id = _a.individualId, type = _a.individualType;
|
|
123
|
+
return __awaiter(void 0, void 0, void 0, function () {
|
|
124
|
+
var data, individualData, boardData, serviceCallBack, _b, boardRes, individualRes;
|
|
125
|
+
var _c, _d, _e;
|
|
126
|
+
return __generator(this, function (_f) {
|
|
127
|
+
switch (_f.label) {
|
|
128
|
+
case 0: return [4, API.boardService.retrieveBoardDetails(boardId)];
|
|
129
|
+
case 1:
|
|
130
|
+
data = _f.sent();
|
|
131
|
+
individualData = data === null || data === void 0 ? void 0 : data.user;
|
|
132
|
+
boardData = data;
|
|
133
|
+
if (!(((_c = data === null || data === void 0 ? void 0 : data.user) === null || _c === void 0 ? void 0 : _c.id) !== id && id)) return [3, 3];
|
|
134
|
+
serviceCallBack = function () { return API.individualService.retrieveIndividual(id, type); };
|
|
135
|
+
return [4, retrieveIndividualData(type, data, serviceCallBack)];
|
|
136
|
+
case 2:
|
|
137
|
+
_b = _f.sent(), boardRes = _b.boardRes, individualRes = _b.individualRes;
|
|
138
|
+
individualData = individualRes;
|
|
139
|
+
boardData = boardRes;
|
|
140
|
+
_f.label = 3;
|
|
141
|
+
case 3: return [2, __assign(__assign({}, boardData), { brand: boardData === null || boardData === void 0 ? void 0 : boardData.brand, bank_account: boardData === null || boardData === void 0 ? void 0 : boardData.bank_account, entity: boardData === null || boardData === void 0 ? void 0 : boardData.entity, merchant: boardData === null || boardData === void 0 ? void 0 : boardData.merchant, name: (_d = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _d === void 0 ? void 0 : _d.names, individuals: boardData === null || boardData === void 0 ? void 0 : boardData.individuals, contact: (_e = boardData === null || boardData === void 0 ? void 0 : boardData.user) === null || _e === void 0 ? void 0 : _e.contact, user: individualData })];
|
|
142
|
+
}
|
|
143
|
+
});
|
|
154
144
|
});
|
|
155
|
-
});
|
|
145
|
+
});
|
|
156
146
|
export var verifyPasswordLeadOTP = createAsyncThunk('verifyPasswordLeadOTP', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
157
|
-
var _a, password, settings, responseBody, payload, data,
|
|
158
|
-
var
|
|
159
|
-
return __generator(this, function (
|
|
160
|
-
switch (
|
|
147
|
+
var _a, password, settings, responseBody, payload, data, _b, config, board_info_password_status, country_code, board_id, countryIso2, publicKey, data_2;
|
|
148
|
+
var _c, _d, _e, _f, _g;
|
|
149
|
+
return __generator(this, function (_h) {
|
|
150
|
+
switch (_h.label) {
|
|
161
151
|
case 0:
|
|
162
152
|
_a = thunkApi.getState(), password = _a.password, settings = _a.settings;
|
|
163
153
|
responseBody = password.data.verify.responseBody;
|
|
164
154
|
payload = {
|
|
165
155
|
data: params.otp,
|
|
166
|
-
service_name: (
|
|
156
|
+
service_name: (_c = responseBody === null || responseBody === void 0 ? void 0 : responseBody.verification_by) === null || _c === void 0 ? void 0 : _c.service_name,
|
|
167
157
|
verify_token: responseBody === null || responseBody === void 0 ? void 0 : responseBody.verify_token,
|
|
168
158
|
step_name: PASSWORD_STEP_NAMES.PHONE_AUTH,
|
|
169
159
|
encryption_contract: ['data']
|
|
170
160
|
};
|
|
171
161
|
return [4, API.leadService.verifyLeadOTP(payload)];
|
|
172
162
|
case 1:
|
|
173
|
-
data = (
|
|
174
|
-
if (
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
(
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
return [
|
|
163
|
+
data = (_h.sent()).data;
|
|
164
|
+
if ((_d = data === null || data === void 0 ? void 0 : data.errors) === null || _d === void 0 ? void 0 : _d.length)
|
|
165
|
+
throw new Error(data.errors[0].description);
|
|
166
|
+
_b = data || {}, config = _b.config, board_info_password_status = _b.board_info_password_status, country_code = _b.country_code, board_id = _b.board_id;
|
|
167
|
+
countryIso2 = country_code;
|
|
168
|
+
if (countryIso2)
|
|
169
|
+
thunkApi.dispatch(handleSetCountryByIso2(countryIso2));
|
|
170
|
+
publicKey = config === null || config === void 0 ? void 0 : config.public_key;
|
|
171
|
+
if (publicKey)
|
|
172
|
+
thunkApi.dispatch(handlePublicKey(publicKey));
|
|
173
|
+
(_f = (_e = settings.data.appConfig).onStepCompleted) === null || _f === void 0 ? void 0 : _f.call(_e, settings.data.activeScreen.name, { otp: params.otp });
|
|
174
|
+
if (!(board_info_password_status === 'completed')) return [3, 2];
|
|
175
|
+
thunkApi.dispatch(handleNextScreenStep('PASSWORD_SUCCESS_FOUR_FLOWS_BUTTONS_STEP'));
|
|
176
|
+
return [3, 5];
|
|
177
|
+
case 2:
|
|
178
|
+
if (!!country_code) return [3, 4];
|
|
179
|
+
return [4, API.boardService.retrieveBoardDetails(board_id)];
|
|
180
|
+
case 3:
|
|
181
|
+
data_2 = _h.sent();
|
|
182
|
+
if ((_g = data_2 === null || data_2 === void 0 ? void 0 : data_2.entity) === null || _g === void 0 ? void 0 : _g.country)
|
|
183
|
+
thunkApi.dispatch(handleSetCountryByIso2(data_2.entity.country));
|
|
184
|
+
_h.label = 4;
|
|
185
|
+
case 4:
|
|
186
|
+
thunkApi.dispatch(handleNextScreenStep('PASSWORD_CREATE_PASSWORD_STEP'));
|
|
187
|
+
_h.label = 5;
|
|
188
|
+
case 5: return [2, { data: data, formData: __assign({}, params) }];
|
|
190
189
|
}
|
|
191
190
|
});
|
|
192
191
|
}); });
|
|
@@ -206,98 +205,108 @@ export var createPassword = createAsyncThunk('createPassword', function (params,
|
|
|
206
205
|
return [4, API.authService.createPassword(requestBody)];
|
|
207
206
|
case 1:
|
|
208
207
|
data = _f.sent();
|
|
209
|
-
thunkApi.dispatch(handleNextScreenStep('PASSWORD_SUCCESS_STEP'));
|
|
208
|
+
sleep(100).then(function () { return thunkApi.dispatch(handleNextScreenStep('PASSWORD_SUCCESS_STEP')); });
|
|
210
209
|
(_e = (_d = settings.data.appConfig).onStepCompleted) === null || _e === void 0 ? void 0 : _e.call(_d, settings.data.activeScreen.name, requestBody);
|
|
211
210
|
return [2, { data: data, formData: params }];
|
|
212
211
|
}
|
|
213
212
|
});
|
|
214
213
|
}); });
|
|
215
214
|
export var updateBoardSuccess = createAsyncThunk('passwordUpdateBoardSuccess', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
216
|
-
var _a, settings, password, _b,
|
|
217
|
-
var
|
|
218
|
-
return __generator(this, function (
|
|
219
|
-
switch (
|
|
215
|
+
var _a, settings, password, _b, board_id, infoId, _c, showBoard, mode, payload, data, _d, id, type, boardInfoStatusData;
|
|
216
|
+
var _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
|
217
|
+
return __generator(this, function (_p) {
|
|
218
|
+
switch (_p.label) {
|
|
220
219
|
case 0:
|
|
221
220
|
_a = thunkApi.getState(), settings = _a.settings, password = _a.password;
|
|
222
|
-
_b = password.data.verify.responseBody || {},
|
|
221
|
+
_b = password.data.verify.responseBody || {}, board_id = _b.board_id, infoId = _b.board_info_id;
|
|
223
222
|
_c = settings.data.appConfig, showBoard = _c.showBoard, mode = _c.mode;
|
|
224
|
-
if (!
|
|
223
|
+
if (!board_id)
|
|
225
224
|
return [2];
|
|
226
225
|
payload = {
|
|
227
226
|
lang: settings.data.language,
|
|
228
|
-
step_name: PASSWORD_STEP_NAMES.PASSWORD_SUCCESS
|
|
229
|
-
id: id
|
|
227
|
+
step_name: PASSWORD_STEP_NAMES.PASSWORD_SUCCESS
|
|
230
228
|
};
|
|
231
|
-
return [4, API.boardService.updateBoardInfo(__assign({ id:
|
|
229
|
+
return [4, API.boardService.updateBoardInfo(__assign({ id: board_id, infoId: infoId }, payload))];
|
|
232
230
|
case 1:
|
|
233
|
-
data =
|
|
231
|
+
data = _p.sent();
|
|
234
232
|
if (!showBoard && mode === 'content') {
|
|
235
|
-
(
|
|
236
|
-
(
|
|
237
|
-
return [2, {
|
|
233
|
+
(_f = (_e = settings.data.appConfig).onStepCompleted) === null || _f === void 0 ? void 0 : _f.call(_e, settings.data.activeScreen.name, {});
|
|
234
|
+
(_h = (_g = settings.data.appConfig).onFlowCompleted) === null || _h === void 0 ? void 0 : _h.call(_g, { data: data });
|
|
235
|
+
return [2, { data: data }];
|
|
238
236
|
}
|
|
239
|
-
|
|
237
|
+
_d = ((_j = data === null || data === void 0 ? void 0 : data.notification) === null || _j === void 0 ? void 0 : _j.recipient) || {}, id = _d.id, type = _d.type;
|
|
238
|
+
return [4, Promise.all([
|
|
239
|
+
API.boardService.retrieveBoardInfoStatus(board_id),
|
|
240
|
+
thunkApi.dispatch(retrieveBoardDetails({ boardId: board_id, individualId: id, individualType: type })).unwrap()
|
|
241
|
+
])];
|
|
240
242
|
case 2:
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
_m.sent();
|
|
245
|
-
(_j = (_h = settings.data.appConfig).onStepCompleted) === null || _j === void 0 ? void 0 : _j.call(_h, settings.data.activeScreen.name, {});
|
|
246
|
-
(_l = (_k = settings.data.appConfig).onFlowCompleted) === null || _l === void 0 ? void 0 : _l.call(_k, { data: data });
|
|
243
|
+
boardInfoStatusData = (_p.sent())[0];
|
|
244
|
+
(_l = (_k = settings.data.appConfig).onStepCompleted) === null || _l === void 0 ? void 0 : _l.call(_k, settings.data.activeScreen.name, {});
|
|
245
|
+
(_o = (_m = settings.data.appConfig).onFlowCompleted) === null || _o === void 0 ? void 0 : _o.call(_m, { data: data });
|
|
247
246
|
thunkApi.dispatch(handleNextScreenStep());
|
|
248
|
-
return [2, {
|
|
247
|
+
return [2, { data: data, flows: (boardInfoStatusData === null || boardInfoStatusData === void 0 ? void 0 : boardInfoStatusData.info) || [] }];
|
|
248
|
+
}
|
|
249
|
+
});
|
|
250
|
+
}); });
|
|
251
|
+
export var retrieveBoardStatus = createAsyncThunk('password/retrieveBoardStatus', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
252
|
+
var password, _a, board_id, board_info_id, recipient, _b, id, type, data;
|
|
253
|
+
return __generator(this, function (_c) {
|
|
254
|
+
switch (_c.label) {
|
|
255
|
+
case 0:
|
|
256
|
+
password = thunkApi.getState().password;
|
|
257
|
+
_a = password.data.verify.responseBody || {}, board_id = _a.board_id, board_info_id = _a.board_info_id, recipient = _a.recipient;
|
|
258
|
+
if (!board_id || !board_info_id)
|
|
259
|
+
throw new Error('Internal server error');
|
|
260
|
+
_b = recipient || {}, id = _b.id, type = _b.type;
|
|
261
|
+
return [4, Promise.all([
|
|
262
|
+
API.boardService.retrieveBoardInfoStatus(board_id),
|
|
263
|
+
thunkApi.dispatch(retrieveBoardDetails({ boardId: board_id, individualId: id, individualType: type })).unwrap()
|
|
264
|
+
])];
|
|
265
|
+
case 1:
|
|
266
|
+
data = (_c.sent())[0];
|
|
267
|
+
thunkApi.dispatch(handlePrevScreenStep());
|
|
268
|
+
return [2, { flows: (data === null || data === void 0 ? void 0 : data.info) || [] }];
|
|
249
269
|
}
|
|
250
270
|
});
|
|
251
271
|
}); });
|
|
252
272
|
export var verifyOperationToken = createAsyncThunk('verifyOperationToken', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
253
|
-
var token, boardId, boardInfoId,
|
|
254
|
-
var
|
|
255
|
-
return __generator(this, function (
|
|
256
|
-
switch (
|
|
273
|
+
var token, boardId, boardInfoId, userId, userType, payload, data, countryIso2, publicKey, data_3;
|
|
274
|
+
var _a, _b, _c;
|
|
275
|
+
return __generator(this, function (_d) {
|
|
276
|
+
switch (_d.label) {
|
|
257
277
|
case 0:
|
|
258
|
-
token = params.token, boardId = params.boardId, boardInfoId = params.boardInfoId;
|
|
259
|
-
boardData = undefined;
|
|
278
|
+
token = params.token, boardId = params.boardId, boardInfoId = params.boardInfoId, userId = params.userId, userType = params.userType;
|
|
260
279
|
payload = {
|
|
261
280
|
auth_type: 7,
|
|
262
281
|
auth_token: token
|
|
263
282
|
};
|
|
264
283
|
return [4, API.authService.verifyAuth(payload)];
|
|
265
284
|
case 1:
|
|
266
|
-
data = (
|
|
267
|
-
if (
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
285
|
+
data = (_d.sent()).data;
|
|
286
|
+
if ((_a = data === null || data === void 0 ? void 0 : data.errors) === null || _a === void 0 ? void 0 : _a.length)
|
|
287
|
+
throw new Error(data.errors[0].description);
|
|
288
|
+
countryIso2 = data === null || data === void 0 ? void 0 : data.country;
|
|
289
|
+
if (countryIso2)
|
|
290
|
+
thunkApi.dispatch(handleSetCountryByIso2(countryIso2));
|
|
291
|
+
publicKey = (_b = data === null || data === void 0 ? void 0 : data.config) === null || _b === void 0 ? void 0 : _b.public_key;
|
|
292
|
+
if (publicKey)
|
|
293
|
+
thunkApi.dispatch(handlePublicKey(publicKey));
|
|
294
|
+
if (!!(data === null || data === void 0 ? void 0 : data.country)) return [3, 3];
|
|
271
295
|
return [4, API.boardService.retrieveBoardDetails(boardId)];
|
|
296
|
+
case 2:
|
|
297
|
+
data_3 = _d.sent();
|
|
298
|
+
if ((_c = data_3 === null || data_3 === void 0 ? void 0 : data_3.entity) === null || _c === void 0 ? void 0 : _c.country)
|
|
299
|
+
thunkApi.dispatch(handleSetCountryByIso2(data_3.entity.country));
|
|
300
|
+
_d.label = 3;
|
|
272
301
|
case 3:
|
|
273
|
-
boardData = _g.sent();
|
|
274
|
-
if ((_c = boardData === null || boardData === void 0 ? void 0 : boardData.entity) === null || _c === void 0 ? void 0 : _c.country)
|
|
275
|
-
thunkApi.dispatch(handleSetCountryByIso2(boardData.entity.country));
|
|
276
|
-
if (!boardInfoId) return [3, 5];
|
|
277
|
-
return [4, API.boardService.retrieveBoardInfo({ id: boardId, infoId: boardInfoId })];
|
|
278
|
-
case 4:
|
|
279
|
-
boardInfoData = _g.sent();
|
|
280
|
-
_g.label = 5;
|
|
281
|
-
case 5:
|
|
282
|
-
_a = ((_d = boardInfoData === null || boardInfoData === void 0 ? void 0 : boardInfoData.notification) === null || _d === void 0 ? void 0 : _d.recipient) || {}, id_2 = _a.id, type_2 = _a.type;
|
|
283
|
-
serviceCallBack = function () { return API.individualService.retrieveIndividual(id_2, type_2); };
|
|
284
|
-
return [4, retrieveIndividualData(type_2, boardData, serviceCallBack)];
|
|
285
|
-
case 6:
|
|
286
|
-
_b = _g.sent(), boardRes = _b.boardRes, individualRes = _b.individualRes;
|
|
287
|
-
boardData = boardRes;
|
|
288
|
-
individualData = individualRes;
|
|
289
|
-
_g.label = 7;
|
|
290
|
-
case 7:
|
|
291
302
|
thunkApi.dispatch(handleNextScreenStep('PASSWORD_CREATE_PASSWORD_STEP'));
|
|
292
|
-
return [2, {
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
flows: (boardStatusData === null || boardStatusData === void 0 ? void 0 : boardStatusData.info) || []
|
|
300
|
-
}];
|
|
303
|
+
return [2, __assign({ data: data, token: token, boardId: boardId, boardInfoId: boardInfoId }, (userId &&
|
|
304
|
+
userType && {
|
|
305
|
+
recipient: {
|
|
306
|
+
id: userId,
|
|
307
|
+
type: userType
|
|
308
|
+
}
|
|
309
|
+
}))];
|
|
301
310
|
}
|
|
302
311
|
});
|
|
303
312
|
}); });
|
|
@@ -320,9 +329,9 @@ export var resendOperationOTP = createAsyncThunk('resendOperationOTPPassword', f
|
|
|
320
329
|
}); });
|
|
321
330
|
export var resetPassword = createAsyncThunk('resetPassword', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
322
331
|
var _a, password, settings, responseBody, passwordData, payload, data;
|
|
323
|
-
var _b, _c;
|
|
324
|
-
return __generator(this, function (
|
|
325
|
-
switch (
|
|
332
|
+
var _b, _c, _d;
|
|
333
|
+
return __generator(this, function (_e) {
|
|
334
|
+
switch (_e.label) {
|
|
326
335
|
case 0:
|
|
327
336
|
_a = thunkApi.getState(), password = _a.password, settings = _a.settings;
|
|
328
337
|
responseBody = password.data.verify.responseBody;
|
|
@@ -339,39 +348,42 @@ export var resetPassword = createAsyncThunk('resetPassword', function (params, t
|
|
|
339
348
|
};
|
|
340
349
|
return [4, API.authService.verifyAuth(payload)];
|
|
341
350
|
case 1:
|
|
342
|
-
data = (
|
|
351
|
+
data = (_e.sent()).data;
|
|
352
|
+
if ((_b = data === null || data === void 0 ? void 0 : data.errors) === null || _b === void 0 ? void 0 : _b.length)
|
|
353
|
+
throw new Error(data.errors[0].description);
|
|
343
354
|
if (!(data === null || data === void 0 ? void 0 : data.errors)) {
|
|
344
|
-
thunkApi.dispatch(handleNextScreenStep('PASSWORD_SUCCESS_STEP'));
|
|
345
|
-
(
|
|
355
|
+
sleep(100).then(function () { return thunkApi.dispatch(handleNextScreenStep('PASSWORD_SUCCESS_STEP')); });
|
|
356
|
+
(_d = (_c = settings.data.appConfig).onStepCompleted) === null || _d === void 0 ? void 0 : _d.call(_c, settings.data.activeScreen.name, payload);
|
|
346
357
|
}
|
|
347
358
|
return [2, { data: data, formData: __assign(__assign({}, params), passwordData) }];
|
|
348
359
|
}
|
|
349
360
|
});
|
|
350
361
|
}); });
|
|
351
362
|
export var retrieveBoardResetPasswordSuccess = createAsyncThunk('retrieveBoardResetPasswordSuccess', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
352
|
-
var _a, password, settings, _b,
|
|
353
|
-
var
|
|
354
|
-
return __generator(this, function (
|
|
355
|
-
switch (
|
|
363
|
+
var _a, password, settings, _b, board_id, boardResponse, recipient, _c, showBoard, mode, _d, id, type, data;
|
|
364
|
+
var _e, _f, _g, _h, _j, _k, _l, _m;
|
|
365
|
+
return __generator(this, function (_o) {
|
|
366
|
+
switch (_o.label) {
|
|
356
367
|
case 0:
|
|
357
368
|
_a = thunkApi.getState(), password = _a.password, settings = _a.settings;
|
|
358
|
-
_b = password.data.verify.responseBody || { board_id: '' },
|
|
369
|
+
_b = password.data.verify.responseBody || { board_id: '' }, board_id = _b.board_id, boardResponse = _b.boardResponse, recipient = _b.recipient;
|
|
359
370
|
_c = settings.data.appConfig, showBoard = _c.showBoard, mode = _c.mode;
|
|
360
371
|
if (!showBoard && mode === 'content') {
|
|
361
|
-
(
|
|
362
|
-
(
|
|
363
|
-
return [2, { id:
|
|
372
|
+
(_f = (_e = settings.data.appConfig).onStepCompleted) === null || _f === void 0 ? void 0 : _f.call(_e, settings.data.activeScreen.name, {});
|
|
373
|
+
(_h = (_g = settings.data.appConfig).onFlowCompleted) === null || _h === void 0 ? void 0 : _h.call(_g, { data: boardResponse });
|
|
374
|
+
return [2, { id: board_id, flows: [] }];
|
|
364
375
|
}
|
|
365
|
-
|
|
376
|
+
_d = recipient || {}, id = _d.id, type = _d.type;
|
|
377
|
+
return [4, Promise.all([
|
|
378
|
+
API.boardService.retrieveBoardInfoStatus(board_id),
|
|
379
|
+
thunkApi.dispatch(retrieveBoardDetails({ boardId: board_id, individualId: id, individualType: type })).unwrap()
|
|
380
|
+
])];
|
|
366
381
|
case 1:
|
|
367
|
-
|
|
368
|
-
return [4, thunkApi.dispatch(retrieveBoardDetails(id))];
|
|
369
|
-
case 2:
|
|
370
|
-
_m.sent();
|
|
382
|
+
data = (_o.sent())[0];
|
|
371
383
|
thunkApi.dispatch(handleNextScreenStep());
|
|
372
|
-
(
|
|
373
|
-
(
|
|
374
|
-
return [2, { id:
|
|
384
|
+
(_k = (_j = settings.data.appConfig).onStepCompleted) === null || _k === void 0 ? void 0 : _k.call(_j, settings.data.activeScreen.name, { id: id });
|
|
385
|
+
(_m = (_l = settings.data.appConfig).onFlowCompleted) === null || _m === void 0 ? void 0 : _m.call(_l, board_id);
|
|
386
|
+
return [2, { id: board_id, flows: (data === null || data === void 0 ? void 0 : data.info) || [] }];
|
|
375
387
|
}
|
|
376
388
|
});
|
|
377
389
|
}); });
|
|
@@ -426,17 +438,11 @@ export var passwordSlice = createSlice({
|
|
|
426
438
|
extraReducers: function (builder) {
|
|
427
439
|
builder
|
|
428
440
|
.addCase(verifyLeadToken.fulfilled, function (state, action) {
|
|
429
|
-
var _a;
|
|
430
441
|
state.data.verify.operationType = PASSWORD_OPERATION_TYPE.SET_PASSWORD;
|
|
431
442
|
state.error = null;
|
|
432
443
|
state.customLoading = false;
|
|
433
|
-
var
|
|
434
|
-
|
|
435
|
-
if (description) {
|
|
436
|
-
state.error = description;
|
|
437
|
-
return;
|
|
438
|
-
}
|
|
439
|
-
state.data.verify.responseBody = __assign(__assign(__assign(__assign({}, data), boardResponse), state.data.verify.responseBody), { board_id: data.id });
|
|
444
|
+
var _a = action.payload, data = _a.data, token = _a.token;
|
|
445
|
+
state.data.verify.responseBody = __assign(__assign(__assign({}, data), state.data.verify.responseBody), { board_id: data.id });
|
|
440
446
|
state.data.verify.token = token;
|
|
441
447
|
})
|
|
442
448
|
.addCase(verifyLeadToken.pending, function (state) {
|
|
@@ -469,17 +475,12 @@ export var passwordSlice = createSlice({
|
|
|
469
475
|
state.error = null;
|
|
470
476
|
})
|
|
471
477
|
.addCase(verifyPasswordLeadOTP.fulfilled, function (state, action) {
|
|
472
|
-
var _a;
|
|
473
478
|
state.loading = false;
|
|
474
479
|
state.error = null;
|
|
475
|
-
var
|
|
476
|
-
var description = (((_a = data === null || data === void 0 ? void 0 : data.errors) === null || _a === void 0 ? void 0 : _a[0]) || {}).description;
|
|
477
|
-
if (description) {
|
|
478
|
-
state.error = description;
|
|
479
|
-
return;
|
|
480
|
-
}
|
|
480
|
+
var _a = action.payload, data = _a.data, formData = _a.formData;
|
|
481
481
|
state.data.otpData = formData;
|
|
482
482
|
state.data.otpData.responseBody = data;
|
|
483
|
+
state.data.verify.responseBody = __assign(__assign(__assign({}, data), state.data.verify.responseBody), { board_id: data.id });
|
|
483
484
|
})
|
|
484
485
|
.addCase(verifyPasswordLeadOTP.rejected, function (state, action) {
|
|
485
486
|
state.loading = false;
|
|
@@ -513,7 +514,7 @@ export var passwordSlice = createSlice({
|
|
|
513
514
|
.addCase(retrieveBoardDetails.fulfilled, function (state, action) {
|
|
514
515
|
state.error = null;
|
|
515
516
|
state.loading = false;
|
|
516
|
-
var data =
|
|
517
|
+
var data = action.payload || {};
|
|
517
518
|
state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), data);
|
|
518
519
|
})
|
|
519
520
|
.addCase(retrieveBoardDetails.rejected, function (state, action) {
|
|
@@ -521,15 +522,11 @@ export var passwordSlice = createSlice({
|
|
|
521
522
|
state.loading = false;
|
|
522
523
|
})
|
|
523
524
|
.addCase(updateBoardSuccess.fulfilled, function (state, action) {
|
|
525
|
+
var _a;
|
|
524
526
|
state.loading = false;
|
|
525
527
|
state.error = null;
|
|
526
|
-
var
|
|
527
|
-
|
|
528
|
-
var _a = state.data.verify.responseBody || {}, individuals = _a.individuals, individualData = _a.individualData;
|
|
529
|
-
var data_state = (individualData || {}).data_state;
|
|
530
|
-
state.data.verify.responseBody = __assign(__assign(__assign(__assign({}, state.data.verify.responseBody), { flows: flows }), (individualData && { user: individualData })), (data_state && {
|
|
531
|
-
individuals: __assign(__assign({}, individuals), { data_state: data_state })
|
|
532
|
-
}));
|
|
528
|
+
var _b = action.payload || {}, flows = _b.flows, data = _b.data;
|
|
529
|
+
state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), { flows: flows, recipient: (_a = data === null || data === void 0 ? void 0 : data.notification) === null || _a === void 0 ? void 0 : _a.recipient });
|
|
533
530
|
})
|
|
534
531
|
.addCase(updateBoardSuccess.pending, function (state) {
|
|
535
532
|
state.loading = true;
|
|
@@ -538,20 +535,27 @@ export var passwordSlice = createSlice({
|
|
|
538
535
|
.addCase(updateBoardSuccess.rejected, function (state, action) {
|
|
539
536
|
state.loading = false;
|
|
540
537
|
state.error = action.error.message;
|
|
538
|
+
})
|
|
539
|
+
.addCase(retrieveBoardStatus.pending, function (state) {
|
|
540
|
+
state.error = null;
|
|
541
|
+
state.loading = true;
|
|
542
|
+
})
|
|
543
|
+
.addCase(retrieveBoardStatus.fulfilled, function (state, action) {
|
|
544
|
+
state.error = null;
|
|
545
|
+
state.loading = false;
|
|
546
|
+
var flows = (action.payload || {}).flows;
|
|
547
|
+
state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), { flows: flows });
|
|
548
|
+
})
|
|
549
|
+
.addCase(retrieveBoardStatus.rejected, function (state, action) {
|
|
550
|
+
state.error = action.error.message;
|
|
551
|
+
state.loading = false;
|
|
541
552
|
})
|
|
542
553
|
.addCase(verifyOperationToken.fulfilled, function (state, action) {
|
|
543
|
-
var _a;
|
|
544
554
|
state.data.verify.operationType = PASSWORD_OPERATION_TYPE.RESET_PASSWORD;
|
|
545
555
|
state.error = null;
|
|
546
556
|
state.customLoading = false;
|
|
547
|
-
var
|
|
548
|
-
state.data.verify.responseBody = __assign(__assign(__assign({},
|
|
549
|
-
var description = (((_a = data === null || data === void 0 ? void 0 : data.errors) === null || _a === void 0 ? void 0 : _a[0]) || {}).description;
|
|
550
|
-
if (description) {
|
|
551
|
-
state.error = description;
|
|
552
|
-
return;
|
|
553
|
-
}
|
|
554
|
-
state.data.verify.responseBody = __assign(__assign(__assign(__assign({}, data), boardResponse), state.data.verify.responseBody), { board_id: boardId, board_info_id: boardInfoId, flows: flows });
|
|
557
|
+
var _a = action.payload, data = _a.data, token = _a.token, boardId = _a.boardId, boardInfoId = _a.boardInfoId, recipient = _a.recipient;
|
|
558
|
+
state.data.verify.responseBody = __assign(__assign(__assign(__assign({}, data), state.data.verify.responseBody), { board_id: boardId, board_info_id: boardInfoId }), (recipient && { recipient: recipient }));
|
|
555
559
|
state.data.verify.token = token;
|
|
556
560
|
})
|
|
557
561
|
.addCase(verifyOperationToken.pending, function (state) {
|
|
@@ -580,16 +584,10 @@ export var passwordSlice = createSlice({
|
|
|
580
584
|
state.error = action.error.message;
|
|
581
585
|
})
|
|
582
586
|
.addCase(resetPassword.fulfilled, function (state, action) {
|
|
583
|
-
var _a;
|
|
584
587
|
state.data.verify.operationType = PASSWORD_OPERATION_TYPE.RESET_PASSWORD;
|
|
585
588
|
state.error = null;
|
|
586
589
|
state.loading = false;
|
|
587
|
-
var
|
|
588
|
-
var description = (((_a = data === null || data === void 0 ? void 0 : data.errors) === null || _a === void 0 ? void 0 : _a[0]) || {}).description;
|
|
589
|
-
if (description) {
|
|
590
|
-
state.error = description;
|
|
591
|
-
return;
|
|
592
|
-
}
|
|
590
|
+
var _a = action.payload, data = _a.data, formData = _a.formData;
|
|
593
591
|
state.data.passwordData = formData;
|
|
594
592
|
state.data.passwordData.responseBody = data;
|
|
595
593
|
})
|
|
@@ -604,13 +602,8 @@ export var passwordSlice = createSlice({
|
|
|
604
602
|
.addCase(retrieveBoardResetPasswordSuccess.fulfilled, function (state, action) {
|
|
605
603
|
state.loading = false;
|
|
606
604
|
state.error = null;
|
|
607
|
-
var
|
|
608
|
-
|
|
609
|
-
var _a = state.data.verify.responseBody || {}, individuals = _a.individuals, individualData = _a.individualData;
|
|
610
|
-
var data_state = (((individualData === null || individualData === void 0 ? void 0 : individualData.is_authorized) ? individuals : individualData) || {}).data_state;
|
|
611
|
-
state.data.verify.responseBody = __assign(__assign(__assign(__assign({}, state.data.verify.responseBody), { flows: flows }), (individualData && { user: individualData })), (data_state && {
|
|
612
|
-
individuals: __assign(__assign({}, individuals), { data_state: data_state })
|
|
613
|
-
}));
|
|
605
|
+
var flows = (action.payload || {}).flows;
|
|
606
|
+
state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), { flows: flows });
|
|
614
607
|
})
|
|
615
608
|
.addCase(retrieveBoardResetPasswordSuccess.pending, function (state) {
|
|
616
609
|
state.loading = true;
|