@open-tender/cloud 0.1.88 → 0.1.89

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.
@@ -190,7 +190,6 @@ exports.submitOrderPay = (0, toolkit_1.createAsyncThunk)(CheckoutActionType.Subm
190
190
  }
191
191
  try {
192
192
  const completedOrder = yield api.postOrder(preparedOrder, token);
193
- console.log('completedOrder', completedOrder);
194
193
  const auth = getState().customer.account.auth;
195
194
  const { email, password } = preparedOrder.customer || {};
196
195
  if (password && !auth) {
@@ -283,6 +282,17 @@ const checkoutSlice = (0, toolkit_1.createSlice)({
283
282
  state.loading = 'idle';
284
283
  state.submitting = false;
285
284
  state.errors = action.payload || {};
285
+ })
286
+ .addCase(exports.submitOrderPay.fulfilled, (_, action) => {
287
+ return Object.assign(Object.assign({}, initialState), { completedOrder: action.payload });
288
+ })
289
+ .addCase(exports.submitOrderPay.pending, state => {
290
+ state.loading = 'pending';
291
+ })
292
+ .addCase(exports.submitOrderPay.rejected, (state, action) => {
293
+ state.loading = 'idle';
294
+ state.submitting = false;
295
+ state.errors = action.payload || {};
286
296
  });
287
297
  }
288
298
  });
@@ -186,7 +186,6 @@ export const submitOrderPay = createAsyncThunk(CheckoutActionType.SubmitOrderPay
186
186
  }
187
187
  try {
188
188
  const completedOrder = yield api.postOrder(preparedOrder, token);
189
- console.log('completedOrder', completedOrder);
190
189
  const auth = getState().customer.account.auth;
191
190
  const { email, password } = preparedOrder.customer || {};
192
191
  if (password && !auth) {
@@ -279,6 +278,17 @@ const checkoutSlice = createSlice({
279
278
  state.loading = 'idle';
280
279
  state.submitting = false;
281
280
  state.errors = action.payload || {};
281
+ })
282
+ .addCase(submitOrderPay.fulfilled, (_, action) => {
283
+ return Object.assign(Object.assign({}, initialState), { completedOrder: action.payload });
284
+ })
285
+ .addCase(submitOrderPay.pending, state => {
286
+ state.loading = 'pending';
287
+ })
288
+ .addCase(submitOrderPay.rejected, (state, action) => {
289
+ state.loading = 'idle';
290
+ state.submitting = false;
291
+ state.errors = action.payload || {};
282
292
  });
283
293
  }
284
294
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@open-tender/cloud",
3
- "version": "0.1.88",
3
+ "version": "0.1.89",
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",