@open-tender/cloud 0.1.18 → 0.1.19
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.
|
@@ -82,7 +82,6 @@ export declare const sendCustomerVerificationEmail: import("@reduxjs/toolkit").A
|
|
|
82
82
|
}>;
|
|
83
83
|
export declare const loginCustomerThanx: import("@reduxjs/toolkit").AsyncThunk<null, {
|
|
84
84
|
email: string;
|
|
85
|
-
origin: any;
|
|
86
85
|
}, {
|
|
87
86
|
state: AppState;
|
|
88
87
|
rejectValue: RequestError;
|
|
@@ -77,12 +77,10 @@ exports.fetchCustomer = (0, toolkit_1.createAsyncThunk)(AccountActionType.FetchC
|
|
|
77
77
|
return (0, exports.checkAuth)(error, dispatch, () => rejectWithValue(error));
|
|
78
78
|
}
|
|
79
79
|
}));
|
|
80
|
-
exports.loginCustomer = (0, toolkit_1.createAsyncThunk)(AccountActionType.LoginCustomer, (
|
|
80
|
+
exports.loginCustomer = (0, toolkit_1.createAsyncThunk)(AccountActionType.LoginCustomer, ({ email, password }, { getState, rejectWithValue }) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
81
81
|
try {
|
|
82
|
-
const { email, password } = data;
|
|
83
82
|
const api = getState().config.api;
|
|
84
|
-
|
|
85
|
-
return auth;
|
|
83
|
+
return yield api.postLogin(email, password);
|
|
86
84
|
}
|
|
87
85
|
catch (err) {
|
|
88
86
|
return rejectWithValue(err);
|
|
@@ -173,10 +171,10 @@ exports.sendCustomerVerificationEmail = (0, toolkit_1.createAsyncThunk)(AccountA
|
|
|
173
171
|
return rejectWithValue(err);
|
|
174
172
|
}
|
|
175
173
|
}));
|
|
176
|
-
exports.loginCustomerThanx = (0, toolkit_1.createAsyncThunk)(AccountActionType.LoginCustomer, (
|
|
174
|
+
exports.loginCustomerThanx = (0, toolkit_1.createAsyncThunk)(AccountActionType.LoginCustomer, ({ email }, { dispatch, getState, rejectWithValue }) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
177
175
|
try {
|
|
178
176
|
const api = getState().config.api;
|
|
179
|
-
yield api.postThanxLogin(
|
|
177
|
+
yield api.postThanxLogin(email);
|
|
180
178
|
dispatch((0, order_2.setAlert)({ type: 'close' }));
|
|
181
179
|
dispatch((0, order_2.addMessage)('Thanks! Please check your email on this device.'));
|
|
182
180
|
return null;
|
|
@@ -82,7 +82,6 @@ export declare const sendCustomerVerificationEmail: import("@reduxjs/toolkit").A
|
|
|
82
82
|
}>;
|
|
83
83
|
export declare const loginCustomerThanx: import("@reduxjs/toolkit").AsyncThunk<null, {
|
|
84
84
|
email: string;
|
|
85
|
-
origin: any;
|
|
86
85
|
}, {
|
|
87
86
|
state: AppState;
|
|
88
87
|
rejectValue: RequestError;
|
|
@@ -72,12 +72,10 @@ export const fetchCustomer = createAsyncThunk(AccountActionType.FetchCustomer,
|
|
|
72
72
|
return checkAuth(error, dispatch, () => rejectWithValue(error));
|
|
73
73
|
}
|
|
74
74
|
}));
|
|
75
|
-
export const loginCustomer = createAsyncThunk(AccountActionType.LoginCustomer, (
|
|
75
|
+
export const loginCustomer = createAsyncThunk(AccountActionType.LoginCustomer, ({ email, password }, { getState, rejectWithValue }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
76
76
|
try {
|
|
77
|
-
const { email, password } = data;
|
|
78
77
|
const api = getState().config.api;
|
|
79
|
-
|
|
80
|
-
return auth;
|
|
78
|
+
return yield api.postLogin(email, password);
|
|
81
79
|
}
|
|
82
80
|
catch (err) {
|
|
83
81
|
return rejectWithValue(err);
|
|
@@ -168,10 +166,10 @@ export const sendCustomerVerificationEmail = createAsyncThunk(AccountActionType.
|
|
|
168
166
|
return rejectWithValue(err);
|
|
169
167
|
}
|
|
170
168
|
}));
|
|
171
|
-
export const loginCustomerThanx = createAsyncThunk(AccountActionType.LoginCustomer, (
|
|
169
|
+
export const loginCustomerThanx = createAsyncThunk(AccountActionType.LoginCustomer, ({ email }, { dispatch, getState, rejectWithValue }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
172
170
|
try {
|
|
173
171
|
const api = getState().config.api;
|
|
174
|
-
yield api.postThanxLogin(
|
|
172
|
+
yield api.postThanxLogin(email);
|
|
175
173
|
dispatch(setAlert({ type: 'close' }));
|
|
176
174
|
dispatch(addMessage('Thanks! Please check your email on this device.'));
|
|
177
175
|
return null;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@open-tender/cloud",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.19",
|
|
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",
|