@open-tender/cloud 0.0.71 → 0.0.73
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, {
|
|
80
|
+
exports.loginCustomer = (0, toolkit_1.createAsyncThunk)(AccountActionType.LoginCustomer, (data, { 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,9 +87,6 @@ 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
|
-
}
|
|
93
90
|
}));
|
|
94
91
|
exports.logoutCustomer = (0, toolkit_1.createAsyncThunk)(AccountActionType.LogoutCustomer, (isReset, { dispatch, getState, rejectWithValue }) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
95
92
|
try {
|
|
@@ -132,7 +129,7 @@ exports.linkPosToken = (0, toolkit_1.createAsyncThunk)(AccountActionType.LinkPos
|
|
|
132
129
|
throw new Error(types_2.MISSING_CUSTOMER);
|
|
133
130
|
yield api.postCustomerPosToken(token, posToken);
|
|
134
131
|
dispatch((0, notifications_1.showNotification)('Order successfully linked!'));
|
|
135
|
-
dispatch(exports.fetchCustomer);
|
|
132
|
+
dispatch((0, exports.fetchCustomer)());
|
|
136
133
|
return;
|
|
137
134
|
}
|
|
138
135
|
catch (err) {
|
|
@@ -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, {
|
|
75
|
+
export const loginCustomer = createAsyncThunk(AccountActionType.LoginCustomer, (data, { 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,9 +82,6 @@ export const loginCustomer = createAsyncThunk(AccountActionType.LoginCustomer, (
|
|
|
82
82
|
catch (err) {
|
|
83
83
|
return rejectWithValue(err);
|
|
84
84
|
}
|
|
85
|
-
finally {
|
|
86
|
-
dispatch(fetchCustomer());
|
|
87
|
-
}
|
|
88
85
|
}));
|
|
89
86
|
export const logoutCustomer = createAsyncThunk(AccountActionType.LogoutCustomer, (isReset, { dispatch, getState, rejectWithValue }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
90
87
|
try {
|
|
@@ -127,7 +124,7 @@ export const linkPosToken = createAsyncThunk(AccountActionType.LinkPosToken, (po
|
|
|
127
124
|
throw new Error(MISSING_CUSTOMER);
|
|
128
125
|
yield api.postCustomerPosToken(token, posToken);
|
|
129
126
|
dispatch(showNotification('Order successfully linked!'));
|
|
130
|
-
dispatch(fetchCustomer);
|
|
127
|
+
dispatch(fetchCustomer());
|
|
131
128
|
return;
|
|
132
129
|
}
|
|
133
130
|
catch (err) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@open-tender/cloud",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.73",
|
|
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",
|
|
@@ -56,6 +56,6 @@
|
|
|
56
56
|
},
|
|
57
57
|
"dependencies": {
|
|
58
58
|
"@open-tender/types": "^0.0.90",
|
|
59
|
-
"@open-tender/utils": "^0.0.
|
|
59
|
+
"@open-tender/utils": "^0.0.28"
|
|
60
60
|
}
|
|
61
61
|
}
|