@open-tender/cloud 0.4.45 → 0.4.47
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.
|
@@ -41,7 +41,7 @@ export declare const submitOrder: import("@reduxjs/toolkit").AsyncThunk<Order, {
|
|
|
41
41
|
fulfilledMeta?: unknown;
|
|
42
42
|
rejectedMeta?: unknown;
|
|
43
43
|
}>;
|
|
44
|
-
export declare const updateForm: import("@reduxjs/toolkit").AsyncThunk<CheckoutState
|
|
44
|
+
export declare const updateForm: import("@reduxjs/toolkit").AsyncThunk<Partial<CheckoutState>, Partial<CheckoutForm>, {
|
|
45
45
|
state: AppState;
|
|
46
46
|
rejectValue: CheckoutErrorMessages;
|
|
47
47
|
dispatch?: Dispatch<import("redux").AnyAction> | undefined;
|
|
@@ -141,7 +141,7 @@ exports.validateOrder = (0, toolkit_1.createAsyncThunk)(CheckoutActionType.Valid
|
|
|
141
141
|
else if ((0, utils_1.contains)(keys, ['customer'])) {
|
|
142
142
|
errors['customer'] = errMessages.customer;
|
|
143
143
|
}
|
|
144
|
-
return { check, errors
|
|
144
|
+
return { check, errors };
|
|
145
145
|
}
|
|
146
146
|
catch (err) {
|
|
147
147
|
const errors = (0, utils_1.makeFormErrorsNested)(err);
|
|
@@ -186,8 +186,10 @@ exports.updateForm = (0, toolkit_1.createAsyncThunk)(CheckoutActionType.UpdateFo
|
|
|
186
186
|
if (tenders)
|
|
187
187
|
delete errors.tenders;
|
|
188
188
|
const form = Object.assign(Object.assign({}, checkout.form), payload);
|
|
189
|
-
return
|
|
190
|
-
|
|
189
|
+
return {
|
|
190
|
+
form,
|
|
191
|
+
errors
|
|
192
|
+
};
|
|
191
193
|
}));
|
|
192
194
|
exports.submitOrderPay = (0, toolkit_1.createAsyncThunk)(CheckoutActionType.SubmitOrderPay, (showAlert = false, { dispatch, getState, rejectWithValue }) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
193
195
|
const { api } = getState().config;
|
|
@@ -276,7 +278,7 @@ const checkoutSlice = (0, toolkit_1.createSlice)({
|
|
|
276
278
|
extraReducers: builder => {
|
|
277
279
|
builder
|
|
278
280
|
.addCase(exports.validateOrder.fulfilled, (state, action) => {
|
|
279
|
-
return Object.assign(Object.assign(Object.assign({}, state), action.payload), { error: null });
|
|
281
|
+
return Object.assign(Object.assign(Object.assign({}, state), action.payload), { loading: 'idle', error: null });
|
|
280
282
|
})
|
|
281
283
|
.addCase(exports.validateOrder.pending, state => {
|
|
282
284
|
state.loading = 'pending';
|
|
@@ -41,7 +41,7 @@ export declare const submitOrder: import("@reduxjs/toolkit").AsyncThunk<Order, {
|
|
|
41
41
|
fulfilledMeta?: unknown;
|
|
42
42
|
rejectedMeta?: unknown;
|
|
43
43
|
}>;
|
|
44
|
-
export declare const updateForm: import("@reduxjs/toolkit").AsyncThunk<CheckoutState
|
|
44
|
+
export declare const updateForm: import("@reduxjs/toolkit").AsyncThunk<Partial<CheckoutState>, Partial<CheckoutForm>, {
|
|
45
45
|
state: AppState;
|
|
46
46
|
rejectValue: CheckoutErrorMessages;
|
|
47
47
|
dispatch?: Dispatch<import("redux").AnyAction> | undefined;
|
|
@@ -137,7 +137,7 @@ export const validateOrder = createAsyncThunk(CheckoutActionType.ValidateOrder,
|
|
|
137
137
|
else if (contains(keys, ['customer'])) {
|
|
138
138
|
errors['customer'] = errMessages.customer;
|
|
139
139
|
}
|
|
140
|
-
return { check, errors
|
|
140
|
+
return { check, errors };
|
|
141
141
|
}
|
|
142
142
|
catch (err) {
|
|
143
143
|
const errors = makeFormErrorsNested(err);
|
|
@@ -182,8 +182,10 @@ export const updateForm = createAsyncThunk(CheckoutActionType.UpdateForm, (paylo
|
|
|
182
182
|
if (tenders)
|
|
183
183
|
delete errors.tenders;
|
|
184
184
|
const form = Object.assign(Object.assign({}, checkout.form), payload);
|
|
185
|
-
return
|
|
186
|
-
|
|
185
|
+
return {
|
|
186
|
+
form,
|
|
187
|
+
errors
|
|
188
|
+
};
|
|
187
189
|
}));
|
|
188
190
|
export const submitOrderPay = createAsyncThunk(CheckoutActionType.SubmitOrderPay, (showAlert = false, { dispatch, getState, rejectWithValue }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
189
191
|
const { api } = getState().config;
|
|
@@ -272,7 +274,7 @@ const checkoutSlice = createSlice({
|
|
|
272
274
|
extraReducers: builder => {
|
|
273
275
|
builder
|
|
274
276
|
.addCase(validateOrder.fulfilled, (state, action) => {
|
|
275
|
-
return Object.assign(Object.assign(Object.assign({}, state), action.payload), { error: null });
|
|
277
|
+
return Object.assign(Object.assign(Object.assign({}, state), action.payload), { loading: 'idle', error: null });
|
|
276
278
|
})
|
|
277
279
|
.addCase(validateOrder.pending, state => {
|
|
278
280
|
state.loading = 'pending';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@open-tender/cloud",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.47",
|
|
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",
|