ordering-components-external 13.2.2 → 13.2.4

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.
Files changed (21) hide show
  1. package/_bundles/{7.ordering-component.d394bb5e0379a08d6e91.js → 7.ordering-component.b53a9e7347b877c40384.js} +1 -1
  2. package/_bundles/{ordering-component.d394bb5e0379a08d6e91.js → ordering-component.b53a9e7347b877c40384.js} +2 -2
  3. package/_modules/components/BusinessAndProductList/index.js +8 -7
  4. package/_modules/components/OrderListGroups/index.js +1 -1
  5. package/_modules/components/OrdersDashboardComponents/BusinessProductsListing/index.js +6 -6
  6. package/_modules/components/ProductForm/index.js +10 -10
  7. package/_modules/components/ProductItemAccordion/index.js +3 -3
  8. package/_modules/components/StoreProductList/index.js +8 -8
  9. package/_modules/utils/index.js +2 -2
  10. package/package.json +1 -1
  11. package/src/components/BusinessAndProductList/index.js +10 -9
  12. package/src/components/OrderListGroups/index.js +1 -1
  13. /package/_bundles/{0.ordering-component.d394bb5e0379a08d6e91.js → 0.ordering-component.b53a9e7347b877c40384.js} +0 -0
  14. /package/_bundles/{1.ordering-component.d394bb5e0379a08d6e91.js → 1.ordering-component.b53a9e7347b877c40384.js} +0 -0
  15. /package/_bundles/{2.ordering-component.d394bb5e0379a08d6e91.js → 2.ordering-component.b53a9e7347b877c40384.js} +0 -0
  16. /package/_bundles/{4.ordering-component.d394bb5e0379a08d6e91.js → 4.ordering-component.b53a9e7347b877c40384.js} +0 -0
  17. /package/_bundles/{5.ordering-component.d394bb5e0379a08d6e91.js → 5.ordering-component.b53a9e7347b877c40384.js} +0 -0
  18. /package/_bundles/{6.ordering-component.d394bb5e0379a08d6e91.js → 6.ordering-component.b53a9e7347b877c40384.js} +0 -0
  19. /package/_bundles/{7.ordering-component.d394bb5e0379a08d6e91.js.LICENSE.txt → 7.ordering-component.b53a9e7347b877c40384.js.LICENSE.txt} +0 -0
  20. /package/_bundles/{8.ordering-component.d394bb5e0379a08d6e91.js → 8.ordering-component.b53a9e7347b877c40384.js} +0 -0
  21. /package/_bundles/{ordering-component.d394bb5e0379a08d6e91.js.LICENSE.txt → ordering-component.b53a9e7347b877c40384.js.LICENSE.txt} +0 -0
@@ -255,10 +255,10 @@ var BusinessAndProductList = exports.BusinessAndProductList = function BusinessA
255
255
  }));
256
256
  };
257
257
  var subCategoriesList = [];
258
- var iterateCategories = function iterateCategories(categories) {
258
+ var _iterateCategories = function iterateCategories(categories) {
259
259
  return (categories === null || categories === void 0 ? void 0 : categories.length) > 0 && (categories === null || categories === void 0 ? void 0 : categories.forEach(function (category) {
260
260
  subCategoriesList.push(category);
261
- iterateCategories(category.subcategories);
261
+ _iterateCategories(category.subcategories);
262
262
  }));
263
263
  };
264
264
 
@@ -343,7 +343,7 @@ var BusinessAndProductList = exports.BusinessAndProductList = function BusinessA
343
343
  loading: false
344
344
  });
345
345
  if (categorySelected.id !== 'featured' && categorySelected.id !== null) {
346
- iterateCategories(businessState === null || businessState === void 0 || (_businessState$busine4 = businessState.business) === null || _businessState$busine4 === void 0 ? void 0 : _businessState$busine4.categories);
346
+ _iterateCategories(businessState === null || businessState === void 0 || (_businessState$busine4 = businessState.business) === null || _businessState$busine4 === void 0 ? void 0 : _businessState$busine4.categories);
347
347
  categoriesList = (_ref3 = []).concat.apply(_ref3, _toConsumableArray(businessState === null || businessState === void 0 || (_businessState$busine5 = businessState.business) === null || _businessState$busine5 === void 0 ? void 0 : _businessState$busine5.categories.map(function (category) {
348
348
  return category.children;
349
349
  })));
@@ -865,7 +865,8 @@ var BusinessAndProductList = exports.BusinessAndProductList = function BusinessA
865
865
  requestsState.product = source;
866
866
  parameters = {
867
867
  type: ((_orderState$options5 = orderState.options) === null || _orderState$options5 === void 0 ? void 0 : _orderState$options5.type) || 1,
868
- moment: ((_orderState$options6 = orderState.options) === null || _orderState$options6 === void 0 ? void 0 : _orderState$options6.moment) || null
868
+ moment: ((_orderState$options6 = orderState.options) === null || _orderState$options6 === void 0 ? void 0 : _orderState$options6.moment) || null,
869
+ version: 'v2'
869
870
  };
870
871
  if ((_orderState$options7 = orderState.options) !== null && _orderState$options7 !== void 0 && _orderState$options7.moment && isValidMoment((_orderState$options8 = orderState.options) === null || _orderState$options8 === void 0 ? void 0 : _orderState$options8.moment, 'YYYY-MM-DD HH:mm:ss')) {
871
872
  moment = _dayjs.default.utc((_orderState$options9 = orderState.options) === null || _orderState$options9 === void 0 ? void 0 : _orderState$options9.moment, 'YYYY-MM-DD HH:mm:ss').local().unix();
@@ -1031,14 +1032,14 @@ var BusinessAndProductList = exports.BusinessAndProductList = function BusinessA
1031
1032
  })
1032
1033
  }));
1033
1034
  };
1034
- var updateCategories = function updateCategories(categories, result) {
1035
+ var _updateCategories = function updateCategories(categories, result) {
1035
1036
  return categories.map(function (category) {
1036
1037
  if (category.id === result.id) {
1037
1038
  return _objectSpread(_objectSpread({}, category), result);
1038
1039
  }
1039
1040
  if (Array.isArray(category === null || category === void 0 ? void 0 : category.subcategories) && category.subcategories.length > 0) {
1040
1041
  return _objectSpread(_objectSpread({}, category), {}, {
1041
- subcategories: updateCategories(category.subcategories, result)
1042
+ subcategories: _updateCategories(category.subcategories, result)
1042
1043
  });
1043
1044
  }
1044
1045
  return category;
@@ -1120,7 +1121,7 @@ var BusinessAndProductList = exports.BusinessAndProductList = function BusinessA
1120
1121
  result = _yield$ordering$busin7.result;
1121
1122
  error = _yield$ordering$busin7.error;
1122
1123
  if (!error) {
1123
- updatedCategories = updateCategories(businessState === null || businessState === void 0 ? void 0 : businessState.business.categories, result);
1124
+ updatedCategories = _updateCategories(businessState === null || businessState === void 0 ? void 0 : businessState.business.categories, result);
1124
1125
  updatedBusiness = _objectSpread(_objectSpread({}, businessState === null || businessState === void 0 ? void 0 : businessState.business), {}, {
1125
1126
  categories: updatedCategories
1126
1127
  });
@@ -1380,7 +1380,7 @@ var OrderListGroups = exports.OrderListGroups = function OrderListGroups(props)
1380
1380
  var _order$payment_events, _ordersGroup, _getStatusById;
1381
1381
  if (!(order !== null && order !== void 0 && order.products) || !(order !== null && order !== void 0 && order.summary) || typeof (order === null || order === void 0 ? void 0 : order.status) !== 'number' || !(order !== null && order !== void 0 && order.customer) || !(order !== null && order !== void 0 && order.business) || !(order !== null && order !== void 0 && order.paymethod) && !(order !== null && order !== void 0 && (_order$payment_events = order.payment_events) !== null && _order$payment_events !== void 0 && _order$payment_events.some(function (e) {
1382
1382
  return e.event === 'payment';
1383
- }))) {
1383
+ })) && (order === null || order === void 0 ? void 0 : order.total) !== 0) {
1384
1384
  return;
1385
1385
  }
1386
1386
  delete order.total;
@@ -696,7 +696,7 @@ var BusinessProductsListing = exports.BusinessProductsListing = function Busines
696
696
  isRemove = _ref8.isRemove,
697
697
  id = _ref8.id;
698
698
  var _categories = _toConsumableArray(businessState === null || businessState === void 0 || (_businessState$busine9 = businessState.business) === null || _businessState$busine9 === void 0 ? void 0 : _businessState$busine9.categories);
699
- var replaceSameTaxes = function replaceSameTaxes(categories, tax) {
699
+ var _replaceSameTaxes = function replaceSameTaxes(categories, tax) {
700
700
  for (var i = 0; i < (categories === null || categories === void 0 ? void 0 : categories.length); i++) {
701
701
  var _category$subcategori2;
702
702
  var category = categories[i];
@@ -712,14 +712,14 @@ var BusinessProductsListing = exports.BusinessProductsListing = function Busines
712
712
  }
713
713
  }
714
714
  if (((_category$subcategori2 = category.subcategories) === null || _category$subcategori2 === void 0 ? void 0 : _category$subcategori2.length) > 0) {
715
- categories.subcategories = replaceSameTaxes(categories.subcategories, tax);
715
+ categories.subcategories = _replaceSameTaxes(categories.subcategories, tax);
716
716
  }
717
717
  }
718
718
  return categories;
719
719
  };
720
720
  setBusinessState(_objectSpread(_objectSpread({}, businessState), {}, {
721
721
  business: _objectSpread(_objectSpread({}, businessState.business), {}, {
722
- categories: replaceSameTaxes(_categories, tax)
722
+ categories: _replaceSameTaxes(_categories, tax)
723
723
  })
724
724
  }));
725
725
  };
@@ -728,7 +728,7 @@ var BusinessProductsListing = exports.BusinessProductsListing = function Busines
728
728
  var fee = _ref9.fee,
729
729
  isRemove = _ref9.isRemove;
730
730
  var _categories = _toConsumableArray(businessState === null || businessState === void 0 || (_businessState$busine10 = businessState.business) === null || _businessState$busine10 === void 0 ? void 0 : _businessState$busine10.categories);
731
- var replaceSameFees = function replaceSameFees(categories, fee) {
731
+ var _replaceSameFees = function replaceSameFees(categories, fee) {
732
732
  for (var i = 0; i < (categories === null || categories === void 0 ? void 0 : categories.length); i++) {
733
733
  var _category$subcategori3;
734
734
  var category = categories[i];
@@ -744,14 +744,14 @@ var BusinessProductsListing = exports.BusinessProductsListing = function Busines
744
744
  }
745
745
  }
746
746
  if (((_category$subcategori3 = category.subcategories) === null || _category$subcategori3 === void 0 ? void 0 : _category$subcategori3.length) > 0) {
747
- categories.subcategories = replaceSameFees(categories.subcategories, fee);
747
+ categories.subcategories = _replaceSameFees(categories.subcategories, fee);
748
748
  }
749
749
  }
750
750
  return categories;
751
751
  };
752
752
  setBusinessState(_objectSpread(_objectSpread({}, businessState), {}, {
753
753
  business: _objectSpread(_objectSpread({}, businessState.business), {}, {
754
- categories: replaceSameFees(_categories, fee)
754
+ categories: _replaceSameFees(_categories, fee)
755
755
  })
756
756
  }));
757
757
  };
@@ -465,7 +465,7 @@ var ProductForm = exports.ProductForm = function ProductForm(props) {
465
465
  * @param {object} cart Current cart
466
466
  * @param {number} suboptionId Suboption id
467
467
  */
468
- var removeRelatedOptions = function removeRelatedOptions(productCart, suboptionId) {
468
+ var _removeRelatedOptions = function removeRelatedOptions(productCart, suboptionId) {
469
469
  product.product.extras.forEach(function (_extra) {
470
470
  _extra.options.forEach(function (_option) {
471
471
  if (_option.respect_to === suboptionId) {
@@ -473,7 +473,7 @@ var ProductForm = exports.ProductForm = function ProductForm(props) {
473
473
  var suboptions = (_productCart$options2 = productCart.options["id:".concat(_option.id)]) === null || _productCart$options2 === void 0 ? void 0 : _productCart$options2.suboptions;
474
474
  if (suboptions) {
475
475
  Object.keys(suboptions).map(function (suboptionKey) {
476
- return removeRelatedOptions(productCart, parseInt(suboptionKey.split(':')[1]));
476
+ return _removeRelatedOptions(productCart, parseInt(suboptionKey.split(':')[1]));
477
477
  });
478
478
  }
479
479
  if (productCart.options["id:".concat(_option.id)]) {
@@ -520,14 +520,14 @@ var ProductForm = exports.ProductForm = function ProductForm(props) {
520
520
  var newPizzaState = {};
521
521
  if (!state.selected) {
522
522
  delete newProductCart.options["id:".concat(option.id)].suboptions["id:".concat(suboption.id)];
523
- removeRelatedOptions(newProductCart, suboption.id);
523
+ _removeRelatedOptions(newProductCart, suboption.id);
524
524
  newPizzaState = handleVerifyPizzaState(state, suboption, option);
525
525
  } else {
526
526
  if (option.min === option.max && option.min === 1) {
527
527
  var suboptions = newProductCart.options["id:".concat(option.id)].suboptions;
528
528
  if (suboptions) {
529
529
  Object.keys(suboptions).map(function (suboptionKey) {
530
- return removeRelatedOptions(newProductCart, parseInt(suboptionKey.split(':')[1]));
530
+ return _removeRelatedOptions(newProductCart, parseInt(suboptionKey.split(':')[1]));
531
531
  });
532
532
  }
533
533
  if (newProductCart.options["id:".concat(option.id)]) {
@@ -628,7 +628,7 @@ var ProductForm = exports.ProductForm = function ProductForm(props) {
628
628
  try {
629
629
  for (_iterator8.s(); !(_step8 = _iterator8.n()).done;) {
630
630
  var _suboption2 = _step8.value;
631
- if (checkSuboptionsSelected(_suboption2 === null || _suboption2 === void 0 ? void 0 : _suboption2.id, _selectedSuboptions, dependsSuboptions)) {
631
+ if (_checkSuboptionsSelected(_suboption2 === null || _suboption2 === void 0 ? void 0 : _suboption2.id, _selectedSuboptions, dependsSuboptions)) {
632
632
  preselectedOptions.push(_option4);
633
633
  preselectedSuboptions.push(_suboption2);
634
634
  }
@@ -715,13 +715,13 @@ var ProductForm = exports.ProductForm = function ProductForm(props) {
715
715
  }
716
716
  if (!(state !== null && state !== void 0 && state.selected)) {
717
717
  delete newProductCart.options["id:".concat(option.id)].suboptions["id:".concat(suboption.id)];
718
- removeRelatedOptions(newProductCart, suboption.id);
718
+ _removeRelatedOptions(newProductCart, suboption.id);
719
719
  } else {
720
720
  if (option.min === option.max && option.min === 1) {
721
721
  var suboptions = newProductCart.options["id:".concat(option.id)].suboptions;
722
722
  if (suboptions) {
723
723
  Object.keys(suboptions).map(function (suboptionKey) {
724
- return removeRelatedOptions(newProductCart, parseInt(suboptionKey.split(':')[1]));
724
+ return _removeRelatedOptions(newProductCart, parseInt(suboptionKey.split(':')[1]));
725
725
  });
726
726
  }
727
727
  if (newProductCart.options["id:".concat(option.id)]) {
@@ -1123,7 +1123,7 @@ var ProductForm = exports.ProductForm = function ProductForm(props) {
1123
1123
  * Check if there is an option required with one suboption
1124
1124
  */
1125
1125
 
1126
- var checkSuboptionsSelected = function checkSuboptionsSelected(suboptionId, _selectedSuboptions, _dependsSuboptions) {
1126
+ var _checkSuboptionsSelected = function checkSuboptionsSelected(suboptionId, _selectedSuboptions, _dependsSuboptions) {
1127
1127
  var _dependsSuboptions2;
1128
1128
  var count = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
1129
1129
  if (count > 100) {
@@ -1136,7 +1136,7 @@ var ProductForm = exports.ProductForm = function ProductForm(props) {
1136
1136
  if (respectTo === null) {
1137
1137
  return _selectedSuboptions["suboption:".concat(suboptionId)];
1138
1138
  }
1139
- return checkSuboptionsSelected(respectTo, _selectedSuboptions, _dependsSuboptions, count++);
1139
+ return _checkSuboptionsSelected(respectTo, _selectedSuboptions, _dependsSuboptions, count++);
1140
1140
  };
1141
1141
  (0, _react.useEffect)(function () {
1142
1142
  var _product$product11;
@@ -1205,7 +1205,7 @@ var ProductForm = exports.ProductForm = function ProductForm(props) {
1205
1205
  try {
1206
1206
  for (_iterator14.s(); !(_step14 = _iterator14.n()).done;) {
1207
1207
  var _suboption3 = _step14.value;
1208
- if (checkSuboptionsSelected(_suboption3 === null || _suboption3 === void 0 ? void 0 : _suboption3.id, _selectedSuboptions, _dependsSuboptions)) {
1208
+ if (_checkSuboptionsSelected(_suboption3 === null || _suboption3 === void 0 ? void 0 : _suboption3.id, _selectedSuboptions, _dependsSuboptions)) {
1209
1209
  preselectedOptions.push(_option5);
1210
1210
  preselectedSuboptions.push(_suboption3);
1211
1211
  }
@@ -31,7 +31,7 @@ var ProductItemAccordion = exports.ProductItemAccordion = function ProductItemAc
31
31
  /**
32
32
  * Run productInfo to sort product options
33
33
  */
34
- var productInfo = function productInfo() {
34
+ var _productInfo = function productInfo() {
35
35
  var _product$options;
36
36
  var options = JSON.parse(JSON.stringify(Object.values((_product$options = product.options) !== null && _product$options !== void 0 ? _product$options : {})));
37
37
  var extraGroups = options.reduce(function (acc, option) {
@@ -69,7 +69,7 @@ var ProductItemAccordion = exports.ProductItemAccordion = function ProductItemAc
69
69
  option.suboptions = Object.values((_option$suboptions = option.suboptions) !== null && _option$suboptions !== void 0 ? _option$suboptions : {});
70
70
  return option;
71
71
  });
72
- return _objectSpread(_objectSpread({}, productInfo), {}, {
72
+ return _objectSpread(_objectSpread({}, _productInfo), {}, {
73
73
  ingredients: ingredients,
74
74
  options: options
75
75
  });
@@ -79,7 +79,7 @@ var ProductItemAccordion = exports.ProductItemAccordion = function ProductItemAc
79
79
  });
80
80
  };
81
81
  return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, UIComponent && /*#__PURE__*/_react.default.createElement(UIComponent, _extends({}, props, {
82
- productInfo: productInfo()
82
+ productInfo: _productInfo()
83
83
  })));
84
84
  };
85
85
  ProductItemAccordion.propTypes = {
@@ -222,14 +222,14 @@ var StoreProductList = exports.StoreProductList = function StoreProductList(prop
222
222
  return _ref2.apply(this, arguments);
223
223
  };
224
224
  }();
225
- var updateCategories = function updateCategories(categories, result) {
225
+ var _updateCategories = function updateCategories(categories, result) {
226
226
  return categories.map(function (category) {
227
227
  if (category.id === result.id) {
228
228
  return _objectSpread(_objectSpread({}, category), result);
229
229
  }
230
230
  if (Array.isArray(category === null || category === void 0 ? void 0 : category.subcategories) && category.subcategories.length > 0) {
231
231
  return _objectSpread(_objectSpread({}, category), {}, {
232
- subcategories: updateCategories(category.subcategories, result)
232
+ subcategories: _updateCategories(category.subcategories, result)
233
233
  });
234
234
  }
235
235
  return category;
@@ -311,7 +311,7 @@ var StoreProductList = exports.StoreProductList = function StoreProductList(prop
311
311
  result = _yield$ordering$busin4.result;
312
312
  error = _yield$ordering$busin4.error;
313
313
  if (!error) {
314
- updatedCategories = updateCategories(businessState === null || businessState === void 0 ? void 0 : businessState.business.categories, result);
314
+ updatedCategories = _updateCategories(businessState === null || businessState === void 0 ? void 0 : businessState.business.categories, result);
315
315
  updatedBusiness = _objectSpread(_objectSpread({}, businessState === null || businessState === void 0 ? void 0 : businessState.business), {}, {
316
316
  categories: updatedCategories
317
317
  });
@@ -338,13 +338,13 @@ var StoreProductList = exports.StoreProductList = function StoreProductList(prop
338
338
  return _ref4.apply(this, arguments);
339
339
  };
340
340
  }();
341
- var validCategory = function validCategory(cat, searchVal) {
341
+ var _validCategory = function validCategory(cat, searchVal) {
342
342
  var _cat$subcategories, _cat$name, _cat$subcategories2;
343
343
  if ((cat === null || cat === void 0 || (_cat$subcategories = cat.subcategories) === null || _cat$subcategories === void 0 ? void 0 : _cat$subcategories.length) === 0) return;
344
344
  if (cat !== null && cat !== void 0 && (_cat$name = cat.name) !== null && _cat$name !== void 0 && _cat$name.toLowerCase().includes(searchVal)) return true;
345
345
  var subcategories = cat === null || cat === void 0 || (_cat$subcategories2 = cat.subcategories) === null || _cat$subcategories2 === void 0 ? void 0 : _cat$subcategories2.filter(function (subCat) {
346
346
  var _subCat$name;
347
- return (subCat === null || subCat === void 0 || (_subCat$name = subCat.name) === null || _subCat$name === void 0 || (_subCat$name = _subCat$name.toLowerCase()) === null || _subCat$name === void 0 ? void 0 : _subCat$name.includes(searchVal)) || validCategory(subCat, searchVal);
347
+ return (subCat === null || subCat === void 0 || (_subCat$name = subCat.name) === null || _subCat$name === void 0 || (_subCat$name = _subCat$name.toLowerCase()) === null || _subCat$name === void 0 ? void 0 : _subCat$name.includes(searchVal)) || _validCategory(subCat, searchVal);
348
348
  });
349
349
  return (subcategories === null || subcategories === void 0 ? void 0 : subcategories.length) > 0;
350
350
  };
@@ -359,12 +359,12 @@ var StoreProductList = exports.StoreProductList = function StoreProductList(prop
359
359
  if ((businessState === null || businessState === void 0 || (_businessState$busine5 = businessState.business) === null || _businessState$busine5 === void 0 || (_businessState$busine5 = _businessState$busine5.categories) === null || _businessState$busine5 === void 0 ? void 0 : _businessState$busine5.length) > 0) {
360
360
  var _businessState$busine6;
361
361
  var lowerCaseSearchVal = categorySearch.toLowerCase();
362
- var _updateCategories = businessState === null || businessState === void 0 || (_businessState$busine6 = businessState.business) === null || _businessState$busine6 === void 0 || (_businessState$busine6 = _businessState$busine6.categories) === null || _businessState$busine6 === void 0 ? void 0 : _businessState$busine6.filter(function (cat) {
362
+ var updateCategories = businessState === null || businessState === void 0 || (_businessState$busine6 = businessState.business) === null || _businessState$busine6 === void 0 || (_businessState$busine6 = _businessState$busine6.categories) === null || _businessState$busine6 === void 0 ? void 0 : _businessState$busine6.filter(function (cat) {
363
363
  var _cat$name2;
364
364
  if (cat !== null && cat !== void 0 && (_cat$name2 = cat.name) !== null && _cat$name2 !== void 0 && (_cat$name2 = _cat$name2.toLowerCase()) !== null && _cat$name2 !== void 0 && _cat$name2.includes(lowerCaseSearchVal)) return true;
365
- return validCategory(cat, lowerCaseSearchVal);
365
+ return _validCategory(cat, lowerCaseSearchVal);
366
366
  });
367
- setCategories(_updateCategories);
367
+ setCategories(updateCategories);
368
368
  }
369
369
  }, [categorySearch, businessState === null || businessState === void 0 ? void 0 : businessState.business]);
370
370
  return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, UIComponent && /*#__PURE__*/_react.default.createElement(UIComponent, _extends({}, props, {
@@ -15,7 +15,7 @@ var randomString = exports.randomString = function randomString() {
15
15
  }
16
16
  return result;
17
17
  };
18
- var deepEqual = exports.deepEqual = function deepEqual(object1, object2) {
18
+ var _deepEqual = exports.deepEqual = function deepEqual(object1, object2) {
19
19
  var keys1 = Object.keys(object1);
20
20
  var keys2 = Object.keys(object2);
21
21
  if (keys1.length !== keys2.length) {
@@ -26,7 +26,7 @@ var deepEqual = exports.deepEqual = function deepEqual(object1, object2) {
26
26
  var val1 = object1[key];
27
27
  var val2 = object2[key];
28
28
  var areObjects = isObject(val1) && isObject(val2);
29
- if (areObjects && !deepEqual(val1, val2) || !areObjects && val1 !== val2) {
29
+ if (areObjects && !_deepEqual(val1, val2) || !areObjects && val1 !== val2) {
30
30
  return false;
31
31
  }
32
32
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ordering-components-external",
3
- "version": "13.2.2",
3
+ "version": "13.2.4",
4
4
  "description": "Ordering Internal Dashboard",
5
5
  "main": "./_modules/index.js",
6
6
  "scripts": {
@@ -657,7 +657,8 @@ export const BusinessAndProductList = (props) => {
657
657
  requestsState.product = source
658
658
  const parameters = {
659
659
  type: orderState.options?.type || 1,
660
- moment: orderState.options?.moment || null
660
+ moment: orderState.options?.moment || null,
661
+ version: 'v2'
661
662
  }
662
663
 
663
664
  if (orderState.options?.moment && isValidMoment(orderState.options?.moment, 'YYYY-MM-DD HH:mm:ss')) {
@@ -786,21 +787,21 @@ export const BusinessAndProductList = (props) => {
786
787
  return {
787
788
  ...category,
788
789
  ...result
789
- };
790
+ }
790
791
  }
791
792
  if (Array.isArray(category?.subcategories) && category.subcategories.length > 0) {
792
793
  return {
793
794
  ...category,
794
- subcategories: updateCategories(category.subcategories, result),
795
- };
795
+ subcategories: updateCategories(category.subcategories, result)
796
+ }
796
797
  }
797
- return category;
798
- });
799
- };
798
+ return category
799
+ })
800
+ }
800
801
 
801
802
  const updateStoreProduct = async (categoryId, productId, updateParams = {}) => {
802
803
  try {
803
- const { content: { result, error } } = await ordering.businesses(businessState?.business?.id).categories(categoryId).products(productId).save(updateParams);
804
+ const { content: { result, error } } = await ordering.businesses(businessState?.business?.id).categories(categoryId).products(productId).save(updateParams)
804
805
 
805
806
  if (!error) {
806
807
  const updatedProducts = categoryState.products.map(product => {
@@ -829,7 +830,7 @@ export const BusinessAndProductList = (props) => {
829
830
  const { content: { result, error } } = await ordering.businesses(businessState?.business?.id).categories(categoryId).save(updateParams)
830
831
 
831
832
  if (!error) {
832
- const updatedCategories = updateCategories(businessState?.business.categories, result);
833
+ const updatedCategories = updateCategories(businessState?.business.categories, result)
833
834
  const updatedBusiness = { ...businessState?.business, categories: updatedCategories }
834
835
  setBusinessState({ ...businessState, business: updatedBusiness })
835
836
  showToast(ToastType.Success, result?.enabled
@@ -959,7 +959,7 @@ export const OrderListGroups = (props) => {
959
959
  typeof order?.status !== 'number' ||
960
960
  !order?.customer ||
961
961
  !order?.business ||
962
- (!order?.paymethod && !order?.payment_events?.some(e => e.event === 'payment'))
962
+ ((!order?.paymethod && !order?.payment_events?.some(e => e.event === 'payment')) && order?.total !== 0)
963
963
  ) {
964
964
  return
965
965
  }