@open-tender/utils 0.5.47 → 0.5.48
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.
- package/dist/cjs/utils/cart.js +2 -2
- package/dist/esm/utils/cart.js +2 -2
- package/package.json +1 -1
package/dist/cjs/utils/cart.js
CHANGED
|
@@ -770,7 +770,7 @@ const validateCart = (cart, categories, soldOut, requestedAt) => {
|
|
|
770
770
|
.map((i) => (Object.assign(Object.assign({}, i), { options: Object.values(i.options) })));
|
|
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
|
-
const newGroup = newGroups[group.id];
|
|
773
|
+
const newGroup = newGroups[group.id] || newGroupsByExtId[group.id];
|
|
774
774
|
// check if option group is still part of the item
|
|
775
775
|
if (!newGroup) {
|
|
776
776
|
if (optionCount > 0) {
|
|
@@ -784,7 +784,7 @@ const validateCart = (cart, categories, soldOut, requestedAt) => {
|
|
|
784
784
|
else {
|
|
785
785
|
const updatedOptions = group.options.map(option => {
|
|
786
786
|
const newOption = newGroup.options[option.id] ||
|
|
787
|
-
(option.pos_ext_id &&
|
|
787
|
+
(option.pos_ext_id && newGroup.options[option.pos_ext_id]);
|
|
788
788
|
// check to see if any OLD options aren't avaiilable on the current menu
|
|
789
789
|
// or if any of the options are currently sold out
|
|
790
790
|
if (!newOption ||
|
package/dist/esm/utils/cart.js
CHANGED
|
@@ -734,7 +734,7 @@ export const validateCart = (cart, categories, soldOut, requestedAt) => {
|
|
|
734
734
|
.map((i) => (Object.assign(Object.assign({}, i), { options: Object.values(i.options) })));
|
|
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
|
-
const newGroup = newGroups[group.id];
|
|
737
|
+
const newGroup = newGroups[group.id] || newGroupsByExtId[group.id];
|
|
738
738
|
// check if option group is still part of the item
|
|
739
739
|
if (!newGroup) {
|
|
740
740
|
if (optionCount > 0) {
|
|
@@ -748,7 +748,7 @@ export const validateCart = (cart, categories, soldOut, requestedAt) => {
|
|
|
748
748
|
else {
|
|
749
749
|
const updatedOptions = group.options.map(option => {
|
|
750
750
|
const newOption = newGroup.options[option.id] ||
|
|
751
|
-
(option.pos_ext_id &&
|
|
751
|
+
(option.pos_ext_id && newGroup.options[option.pos_ext_id]);
|
|
752
752
|
// check to see if any OLD options aren't avaiilable on the current menu
|
|
753
753
|
// or if any of the options are currently sold out
|
|
754
754
|
if (!newOption ||
|
package/package.json
CHANGED