@tap-payments/auth-jsconnect 2.0.126-test → 2.1.1-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.
|
@@ -1106,6 +1106,7 @@ export var businessSlice = createSlice({
|
|
|
1106
1106
|
.addCase(updateLeadSuccess.fulfilled, function (state, action) {
|
|
1107
1107
|
var _a, _b;
|
|
1108
1108
|
state.loading = false;
|
|
1109
|
+
state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), { updateLeadSuccessLoading: false });
|
|
1109
1110
|
state.error = null;
|
|
1110
1111
|
var response = (action.payload || {}).response;
|
|
1111
1112
|
var description = (((_a = response === null || response === void 0 ? void 0 : response.errors) === null || _a === void 0 ? void 0 : _a[0]) || {}).description;
|
|
@@ -1117,10 +1118,12 @@ export var businessSlice = createSlice({
|
|
|
1117
1118
|
})
|
|
1118
1119
|
.addCase(updateLeadSuccess.pending, function (state) {
|
|
1119
1120
|
state.loading = true;
|
|
1121
|
+
state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), { updateLeadSuccessLoading: true });
|
|
1120
1122
|
state.error = null;
|
|
1121
1123
|
})
|
|
1122
1124
|
.addCase(updateLeadSuccess.rejected, function (state, action) {
|
|
1123
1125
|
state.loading = false;
|
|
1126
|
+
state.data.verify.responseBody = __assign(__assign({}, state.data.verify.responseBody), { updateLeadSuccessLoading: false });
|
|
1124
1127
|
state.error = action.error.message;
|
|
1125
1128
|
});
|
|
1126
1129
|
}
|
|
@@ -501,6 +501,10 @@ export var updateLeadBrand = createAsyncThunk('updateLeadBrand', function (param
|
|
|
501
501
|
return [4, API.leadService.updateLead(payload)];
|
|
502
502
|
case 5:
|
|
503
503
|
lead = _g.sent();
|
|
504
|
+
if (!lead.brand) {
|
|
505
|
+
console.error('Internal server error: brand is not created');
|
|
506
|
+
throw new Error('Internal server error');
|
|
507
|
+
}
|
|
504
508
|
brandReqBody = {
|
|
505
509
|
id: ((_d = lead.brand) === null || _d === void 0 ? void 0 : _d.id) || '',
|
|
506
510
|
channel_services: channel_services,
|
|
@@ -7,10 +7,17 @@ import { businessSelector, updateLeadSuccess } from '../../../app/business/busin
|
|
|
7
7
|
var Success = function (_a) {
|
|
8
8
|
var t = useTranslation().t;
|
|
9
9
|
var dispatch = useAppDispatch();
|
|
10
|
-
var _b = useAppSelector(businessSelector),
|
|
11
|
-
var
|
|
10
|
+
var _b = useAppSelector(businessSelector), error = _b.error, data = _b.data;
|
|
11
|
+
var _c = React.useState(false), clicked = _c[0], setClicked = _c[1];
|
|
12
|
+
var verify = data.verify;
|
|
13
|
+
var responseBody = verify.responseBody;
|
|
14
|
+
var updateLeadSuccessLoading = (responseBody || {}).updateLeadSuccessLoading;
|
|
15
|
+
React.useEffect(function () {
|
|
12
16
|
dispatch(updateLeadSuccess());
|
|
17
|
+
}, []);
|
|
18
|
+
var onSuccess = function () {
|
|
19
|
+
setClicked(true);
|
|
13
20
|
};
|
|
14
|
-
return (_jsx(SuccessScreen, { title: t('business_completed_title'), description: t('business_completed_description'), onSuccess: onSuccess, successTitle: t('business_completed_button'), loading:
|
|
21
|
+
return (_jsx(SuccessScreen, { title: t('business_completed_title'), description: t('business_completed_description'), onSuccess: onSuccess, successTitle: t('business_completed_button'), loading: clicked && updateLeadSuccessLoading, error: error || '' }));
|
|
15
22
|
};
|
|
16
23
|
export default React.memo(Success);
|