@open-tender/cloud 0.1.36 → 0.1.38
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.
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Dispatch } from '@reduxjs/toolkit';
|
|
2
|
-
import { CheckoutCheck, CheckoutForm, Order, OrderCreate, RequestStatus } from '@open-tender/types';
|
|
2
|
+
import { CheckoutCheck, CheckoutErrorMessages, CheckoutForm, Order, OrderCreate, RequestStatus } from '@open-tender/types';
|
|
3
3
|
import { AppState } from '../app';
|
|
4
4
|
export interface CheckoutState {
|
|
5
5
|
check: CheckoutCheck | null;
|
|
@@ -7,7 +7,7 @@ export interface CheckoutState {
|
|
|
7
7
|
submitting: boolean;
|
|
8
8
|
isGuest: boolean;
|
|
9
9
|
completedOrder: Order | null;
|
|
10
|
-
errors:
|
|
10
|
+
errors: CheckoutErrorMessages;
|
|
11
11
|
loading: RequestStatus;
|
|
12
12
|
}
|
|
13
13
|
export declare enum CheckoutActionType {
|
|
@@ -21,7 +21,7 @@ export declare const validateOrder: import("@reduxjs/toolkit").AsyncThunk<{
|
|
|
21
21
|
errors: any;
|
|
22
22
|
}, OrderCreate | null | undefined, {
|
|
23
23
|
state: AppState;
|
|
24
|
-
rejectValue:
|
|
24
|
+
rejectValue: CheckoutErrorMessages;
|
|
25
25
|
dispatch?: Dispatch<import("redux").AnyAction> | undefined;
|
|
26
26
|
extra?: unknown;
|
|
27
27
|
serializedErrorType?: unknown;
|
|
@@ -31,7 +31,7 @@ export declare const validateOrder: import("@reduxjs/toolkit").AsyncThunk<{
|
|
|
31
31
|
}>;
|
|
32
32
|
export declare const submitOrder: import("@reduxjs/toolkit").AsyncThunk<Order, void, {
|
|
33
33
|
state: AppState;
|
|
34
|
-
rejectValue:
|
|
34
|
+
rejectValue: CheckoutErrorMessages;
|
|
35
35
|
dispatch?: Dispatch<import("redux").AnyAction> | undefined;
|
|
36
36
|
extra?: unknown;
|
|
37
37
|
serializedErrorType?: unknown;
|
|
@@ -163,7 +163,7 @@ exports.submitOrder = (0, toolkit_1.createAsyncThunk)(CheckoutActionType.SubmitO
|
|
|
163
163
|
catch (err) {
|
|
164
164
|
dispatch((0, order_1.setAlert)({ type: 'close' }));
|
|
165
165
|
const errors = handleOrderErrors(err, preparedOrder, dispatch);
|
|
166
|
-
rejectWithValue(errors);
|
|
166
|
+
return rejectWithValue(errors);
|
|
167
167
|
}
|
|
168
168
|
}));
|
|
169
169
|
exports.submitOrderPay = (0, toolkit_1.createAsyncThunk)(CheckoutActionType.SubmitOrderPay, (showAlert = false, { dispatch, getState, rejectWithValue }) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
@@ -194,7 +194,7 @@ exports.submitOrderPay = (0, toolkit_1.createAsyncThunk)(CheckoutActionType.Subm
|
|
|
194
194
|
catch (err) {
|
|
195
195
|
dispatch((0, order_1.setAlert)({ type: 'close' }));
|
|
196
196
|
const errors = handleOrderErrors(err, preparedOrder, dispatch);
|
|
197
|
-
rejectWithValue(errors);
|
|
197
|
+
return rejectWithValue(errors);
|
|
198
198
|
}
|
|
199
199
|
}));
|
|
200
200
|
const checkoutSlice = (0, toolkit_1.createSlice)({
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Dispatch } from '@reduxjs/toolkit';
|
|
2
|
-
import { CheckoutCheck, CheckoutForm, Order, OrderCreate, RequestStatus } from '@open-tender/types';
|
|
2
|
+
import { CheckoutCheck, CheckoutErrorMessages, CheckoutForm, Order, OrderCreate, RequestStatus } from '@open-tender/types';
|
|
3
3
|
import { AppState } from '../app';
|
|
4
4
|
export interface CheckoutState {
|
|
5
5
|
check: CheckoutCheck | null;
|
|
@@ -7,7 +7,7 @@ export interface CheckoutState {
|
|
|
7
7
|
submitting: boolean;
|
|
8
8
|
isGuest: boolean;
|
|
9
9
|
completedOrder: Order | null;
|
|
10
|
-
errors:
|
|
10
|
+
errors: CheckoutErrorMessages;
|
|
11
11
|
loading: RequestStatus;
|
|
12
12
|
}
|
|
13
13
|
export declare enum CheckoutActionType {
|
|
@@ -21,7 +21,7 @@ export declare const validateOrder: import("@reduxjs/toolkit").AsyncThunk<{
|
|
|
21
21
|
errors: any;
|
|
22
22
|
}, OrderCreate | null | undefined, {
|
|
23
23
|
state: AppState;
|
|
24
|
-
rejectValue:
|
|
24
|
+
rejectValue: CheckoutErrorMessages;
|
|
25
25
|
dispatch?: Dispatch<import("redux").AnyAction> | undefined;
|
|
26
26
|
extra?: unknown;
|
|
27
27
|
serializedErrorType?: unknown;
|
|
@@ -31,7 +31,7 @@ export declare const validateOrder: import("@reduxjs/toolkit").AsyncThunk<{
|
|
|
31
31
|
}>;
|
|
32
32
|
export declare const submitOrder: import("@reduxjs/toolkit").AsyncThunk<Order, void, {
|
|
33
33
|
state: AppState;
|
|
34
|
-
rejectValue:
|
|
34
|
+
rejectValue: CheckoutErrorMessages;
|
|
35
35
|
dispatch?: Dispatch<import("redux").AnyAction> | undefined;
|
|
36
36
|
extra?: unknown;
|
|
37
37
|
serializedErrorType?: unknown;
|
|
@@ -159,7 +159,7 @@ export const submitOrder = createAsyncThunk(CheckoutActionType.SubmitOrder, (_,
|
|
|
159
159
|
catch (err) {
|
|
160
160
|
dispatch(setAlert({ type: 'close' }));
|
|
161
161
|
const errors = handleOrderErrors(err, preparedOrder, dispatch);
|
|
162
|
-
rejectWithValue(errors);
|
|
162
|
+
return rejectWithValue(errors);
|
|
163
163
|
}
|
|
164
164
|
}));
|
|
165
165
|
export const submitOrderPay = createAsyncThunk(CheckoutActionType.SubmitOrderPay, (showAlert = false, { dispatch, getState, rejectWithValue }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
@@ -190,7 +190,7 @@ export const submitOrderPay = createAsyncThunk(CheckoutActionType.SubmitOrderPay
|
|
|
190
190
|
catch (err) {
|
|
191
191
|
dispatch(setAlert({ type: 'close' }));
|
|
192
192
|
const errors = handleOrderErrors(err, preparedOrder, dispatch);
|
|
193
|
-
rejectWithValue(errors);
|
|
193
|
+
return rejectWithValue(errors);
|
|
194
194
|
}
|
|
195
195
|
}));
|
|
196
196
|
const checkoutSlice = createSlice({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@open-tender/cloud",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.38",
|
|
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",
|
|
@@ -49,8 +49,8 @@
|
|
|
49
49
|
"typescript": "^4.8.2"
|
|
50
50
|
},
|
|
51
51
|
"peerDependencies": {
|
|
52
|
-
"@open-tender/types": "^0.2.
|
|
53
|
-
"@open-tender/utils": "^0.1.
|
|
52
|
+
"@open-tender/types": "^0.2.23",
|
|
53
|
+
"@open-tender/utils": "^0.1.90",
|
|
54
54
|
"@reduxjs/toolkit": "^1.8.5",
|
|
55
55
|
"react": "^18.2.0"
|
|
56
56
|
},
|