@open-tender/utils 0.5.47 → 0.5.49

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.
@@ -771,6 +771,7 @@ const validateCart = (cart, categories, soldOut, requestedAt) => {
771
771
  const updatedGroups = (_b = oldItem.groups) === null || _b === void 0 ? void 0 : _b.map(group => {
772
772
  const optionCount = group.options.reduce((t, i) => (t += i.quantity), 0);
773
773
  const newGroup = newGroups[group.id];
774
+ const newGroupByExtId = newGroupsByExtId[group.id];
774
775
  // check if option group is still part of the item
775
776
  if (!newGroup) {
776
777
  if (optionCount > 0) {
@@ -784,7 +785,7 @@ const validateCart = (cart, categories, soldOut, requestedAt) => {
784
785
  else {
785
786
  const updatedOptions = group.options.map(option => {
786
787
  const newOption = newGroup.options[option.id] ||
787
- (option.pos_ext_id && newGroupsByExtId[option.pos_ext_id]);
788
+ (option.pos_ext_id && newGroupByExtId.options[option.pos_ext_id]);
788
789
  // check to see if any OLD options aren't avaiilable on the current menu
789
790
  // or if any of the options are currently sold out
790
791
  if (!newOption ||
@@ -735,6 +735,7 @@ export const validateCart = (cart, categories, soldOut, requestedAt) => {
735
735
  const updatedGroups = (_b = oldItem.groups) === null || _b === void 0 ? void 0 : _b.map(group => {
736
736
  const optionCount = group.options.reduce((t, i) => (t += i.quantity), 0);
737
737
  const newGroup = newGroups[group.id];
738
+ const newGroupByExtId = newGroupsByExtId[group.id];
738
739
  // check if option group is still part of the item
739
740
  if (!newGroup) {
740
741
  if (optionCount > 0) {
@@ -748,7 +749,7 @@ export const validateCart = (cart, categories, soldOut, requestedAt) => {
748
749
  else {
749
750
  const updatedOptions = group.options.map(option => {
750
751
  const newOption = newGroup.options[option.id] ||
751
- (option.pos_ext_id && newGroupsByExtId[option.pos_ext_id]);
752
+ (option.pos_ext_id && newGroupByExtId.options[option.pos_ext_id]);
752
753
  // check to see if any OLD options aren't avaiilable on the current menu
753
754
  // or if any of the options are currently sold out
754
755
  if (!newOption ||
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@open-tender/utils",
3
- "version": "0.5.47",
3
+ "version": "0.5.49",
4
4
  "description": "A library of utils 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",