tripstorekrabi-shared 1.23.2 → 1.23.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.
- package/booking.js +11 -11
- package/package.json +1 -1
package/booking.js
CHANGED
|
@@ -367,18 +367,18 @@ export function requiresDietaryInfo(booking, product) {
|
|
|
367
367
|
|
|
368
368
|
const mainIsFood = hasFood(product);
|
|
369
369
|
|
|
370
|
-
const
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
370
|
+
const productFoodAddOns = (product.addOns || []).filter(pAddOn => hasFood(pAddOn));
|
|
371
|
+
|
|
372
|
+
if (productFoodAddOns.length > 0) {
|
|
373
|
+
const hasActiveFoodAddOn = productFoodAddOns.some(pAddOn => {
|
|
374
|
+
const bookedAddOn = (booking?.addOns ?? []).find(bAddOn => bAddOn.id === pAddOn.id);
|
|
375
|
+
if (!bookedAddOn) return false;
|
|
376
|
+
|
|
377
|
+
const totalPax = (bookedAddOn.adults || 0) + (bookedAddOn.children || 0);
|
|
378
|
+
return totalPax > 0;
|
|
379
|
+
});
|
|
379
380
|
|
|
380
|
-
|
|
381
|
-
return hasFoodAddOnWithPax;
|
|
381
|
+
return hasActiveFoodAddOn;
|
|
382
382
|
}
|
|
383
383
|
|
|
384
384
|
return mainIsFood;
|