@open-tender/cloud 0.5.22 → 0.5.24
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.
|
@@ -16,16 +16,17 @@ var SignUpActionType;
|
|
|
16
16
|
exports.signUpCustomer = (0, toolkit_1.createAsyncThunk)(SignUpActionType.SignUpCustomer, ({ data, callback }, { dispatch, getState, rejectWithValue }) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
17
17
|
try {
|
|
18
18
|
const { api, brand } = getState().config;
|
|
19
|
-
const
|
|
19
|
+
const { login_recaptcha } = data, signupData = tslib_1.__rest(data, ["login_recaptcha"]);
|
|
20
|
+
const response = yield api.postSignUp(signupData);
|
|
20
21
|
const { email, password } = data;
|
|
21
22
|
if (email && password) {
|
|
22
23
|
if ((brand === null || brand === void 0 ? void 0 : brand.tpls) && (brand === null || brand === void 0 ? void 0 : brand.tpls) !== 'SPARKFLY') {
|
|
23
|
-
const resp = yield api.postCustomerSignIn(
|
|
24
|
+
const resp = yield api.postCustomerSignIn(Object.assign(Object.assign({}, signupData), { recaptcha_token: login_recaptcha }));
|
|
24
25
|
dispatch((0, customer_1.setCustomerAuth)(resp));
|
|
25
26
|
yield dispatch((0, customer_1.fetchCustomer)());
|
|
26
27
|
}
|
|
27
28
|
else {
|
|
28
|
-
dispatch((0, customer_1.loginCustomer)({ email, password }));
|
|
29
|
+
dispatch((0, customer_1.loginCustomer)({ email, password, recaptcha_token: login_recaptcha }));
|
|
29
30
|
}
|
|
30
31
|
}
|
|
31
32
|
if (callback)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { __awaiter } from "tslib";
|
|
1
|
+
import { __awaiter, __rest } from "tslib";
|
|
2
2
|
import { createAsyncThunk, createSlice } from '@reduxjs/toolkit';
|
|
3
3
|
import { ReducerType } from './types';
|
|
4
4
|
import { fetchCustomer, loginCustomer, setCustomerAuth } from './customer';
|
|
@@ -13,16 +13,17 @@ export var SignUpActionType;
|
|
|
13
13
|
export const signUpCustomer = createAsyncThunk(SignUpActionType.SignUpCustomer, ({ data, callback }, { dispatch, getState, rejectWithValue }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
14
14
|
try {
|
|
15
15
|
const { api, brand } = getState().config;
|
|
16
|
-
const
|
|
16
|
+
const { login_recaptcha } = data, signupData = __rest(data, ["login_recaptcha"]);
|
|
17
|
+
const response = yield api.postSignUp(signupData);
|
|
17
18
|
const { email, password } = data;
|
|
18
19
|
if (email && password) {
|
|
19
20
|
if ((brand === null || brand === void 0 ? void 0 : brand.tpls) && (brand === null || brand === void 0 ? void 0 : brand.tpls) !== 'SPARKFLY') {
|
|
20
|
-
const resp = yield api.postCustomerSignIn(
|
|
21
|
+
const resp = yield api.postCustomerSignIn(Object.assign(Object.assign({}, signupData), { recaptcha_token: login_recaptcha }));
|
|
21
22
|
dispatch(setCustomerAuth(resp));
|
|
22
23
|
yield dispatch(fetchCustomer());
|
|
23
24
|
}
|
|
24
25
|
else {
|
|
25
|
-
dispatch(loginCustomer({ email, password }));
|
|
26
|
+
dispatch(loginCustomer({ email, password, recaptcha_token: login_recaptcha }));
|
|
26
27
|
}
|
|
27
28
|
}
|
|
28
29
|
if (callback)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@open-tender/cloud",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.24",
|
|
4
4
|
"description": "A library of hooks, reducers, utility functions, and types for use with Open Tender applications that utilize our cloud-based Order API.",
|
|
5
5
|
"main": "./dist/cjs/index.js",
|
|
6
6
|
"module": "./dist/esm/index.js",
|
|
@@ -34,8 +34,8 @@
|
|
|
34
34
|
"private": false,
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"@babel/core": "^7.19.1",
|
|
37
|
-
"@open-tender/types": "^0.4.
|
|
38
|
-
"@open-tender/utils": "^0.5.
|
|
37
|
+
"@open-tender/types": "^0.4.156",
|
|
38
|
+
"@open-tender/utils": "^0.5.40",
|
|
39
39
|
"@reduxjs/toolkit": "^1.8.5",
|
|
40
40
|
"@types/react": "^18.0.18",
|
|
41
41
|
"@types/react-dom": "^18.0.6",
|