@open-tender/cloud 0.0.73 → 0.0.74
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.
|
@@ -77,7 +77,7 @@ 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, (data, { getState, rejectWithValue }) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
80
|
+
exports.loginCustomer = (0, toolkit_1.createAsyncThunk)(AccountActionType.LoginCustomer, (data, { dispatch, getState, rejectWithValue }) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
81
81
|
try {
|
|
82
82
|
const { email, password } = data;
|
|
83
83
|
const api = getState().config.api;
|
|
@@ -87,6 +87,9 @@ exports.loginCustomer = (0, toolkit_1.createAsyncThunk)(AccountActionType.LoginC
|
|
|
87
87
|
catch (err) {
|
|
88
88
|
return rejectWithValue(err);
|
|
89
89
|
}
|
|
90
|
+
finally {
|
|
91
|
+
dispatch((0, exports.fetchCustomer)());
|
|
92
|
+
}
|
|
90
93
|
}));
|
|
91
94
|
exports.logoutCustomer = (0, toolkit_1.createAsyncThunk)(AccountActionType.LogoutCustomer, (isReset, { dispatch, getState, rejectWithValue }) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
92
95
|
try {
|
|
@@ -72,7 +72,7 @@ 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, (data, { getState, rejectWithValue }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
75
|
+
export const loginCustomer = createAsyncThunk(AccountActionType.LoginCustomer, (data, { dispatch, getState, rejectWithValue }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
76
76
|
try {
|
|
77
77
|
const { email, password } = data;
|
|
78
78
|
const api = getState().config.api;
|
|
@@ -82,6 +82,9 @@ export const loginCustomer = createAsyncThunk(AccountActionType.LoginCustomer, (
|
|
|
82
82
|
catch (err) {
|
|
83
83
|
return rejectWithValue(err);
|
|
84
84
|
}
|
|
85
|
+
finally {
|
|
86
|
+
dispatch(fetchCustomer());
|
|
87
|
+
}
|
|
85
88
|
}));
|
|
86
89
|
export const logoutCustomer = createAsyncThunk(AccountActionType.LogoutCustomer, (isReset, { dispatch, getState, rejectWithValue }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
87
90
|
try {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@open-tender/cloud",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.74",
|
|
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",
|