@open-tender/cloud 0.4.50 → 0.4.52

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, Partial<CheckoutForm>, {
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;
@@ -47,11 +47,13 @@ const assembleOrder = (orderData, save = false) => {
47
47
  const { deposit = null } = check || {};
48
48
  // const defaultTip = check ? getDefaultTip(check.config) : null
49
49
  const fullAddress = Object.assign(Object.assign({}, order.address), address);
50
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
51
+ const { customer_id } = customer, customerWithoutId = tslib_1.__rest(customer, ["customer_id"]);
50
52
  const data = {
51
53
  address: (0, utils_1.isEmpty)(fullAddress) ? null : fullAddress,
52
54
  cart: cart,
53
55
  cartId: groupOrder.cartId || null,
54
- customer,
56
+ customer: customerWithoutId,
55
57
  deposit,
56
58
  details,
57
59
  deviceType,
@@ -184,8 +186,10 @@ exports.updateForm = (0, toolkit_1.createAsyncThunk)(CheckoutActionType.UpdateFo
184
186
  if (tenders)
185
187
  delete errors.tenders;
186
188
  const form = Object.assign(Object.assign({}, checkout.form), payload);
187
- return Object.assign(Object.assign({}, checkout), { form,
188
- errors });
189
+ return {
190
+ form,
191
+ errors
192
+ };
189
193
  }));
190
194
  exports.submitOrderPay = (0, toolkit_1.createAsyncThunk)(CheckoutActionType.SubmitOrderPay, (showAlert = false, { dispatch, getState, rejectWithValue }) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
191
195
  const { api } = getState().config;
@@ -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, Partial<CheckoutForm>, {
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;
@@ -1,4 +1,4 @@
1
- import { __awaiter } from "tslib";
1
+ import { __awaiter, __rest } from "tslib";
2
2
  import { createAsyncThunk, createSlice } from '@reduxjs/toolkit';
3
3
  import { contains, handleCheckoutError, isEmpty, isString, makeCheckError, makeFormErrorsNested, prepareOrder } from '@open-tender/utils';
4
4
  import { ReducerType } from './types';
@@ -43,11 +43,13 @@ const assembleOrder = (orderData, save = false) => {
43
43
  const { deposit = null } = check || {};
44
44
  // const defaultTip = check ? getDefaultTip(check.config) : null
45
45
  const fullAddress = Object.assign(Object.assign({}, order.address), address);
46
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
47
+ const { customer_id } = customer, customerWithoutId = __rest(customer, ["customer_id"]);
46
48
  const data = {
47
49
  address: isEmpty(fullAddress) ? null : fullAddress,
48
50
  cart: cart,
49
51
  cartId: groupOrder.cartId || null,
50
- customer,
52
+ customer: customerWithoutId,
51
53
  deposit,
52
54
  details,
53
55
  deviceType,
@@ -180,8 +182,10 @@ export const updateForm = createAsyncThunk(CheckoutActionType.UpdateForm, (paylo
180
182
  if (tenders)
181
183
  delete errors.tenders;
182
184
  const form = Object.assign(Object.assign({}, checkout.form), payload);
183
- return Object.assign(Object.assign({}, checkout), { form,
184
- errors });
185
+ return {
186
+ form,
187
+ errors
188
+ };
185
189
  }));
186
190
  export const submitOrderPay = createAsyncThunk(CheckoutActionType.SubmitOrderPay, (showAlert = false, { dispatch, getState, rejectWithValue }) => __awaiter(void 0, void 0, void 0, function* () {
187
191
  const { api } = getState().config;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@open-tender/cloud",
3
- "version": "0.4.50",
3
+ "version": "0.4.52",
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",