Merged in fix/add-breakfast-wrong-quantity (pull request #2086)
fix: check if breakfast and refill modal with correct confirmation if cancelled/error payment * fix: check if breakfast and refill modal with correct confirmation if cancelled/error payment * fix: only include packages with quantity Approved-by: Linus Flood Approved-by: Matilda Landström
This commit is contained in:
@@ -226,7 +226,7 @@ export default function AddAncillaryFlowModal({
|
||||
data: AncillaryFormData,
|
||||
breakfastData: BreakfastData
|
||||
) {
|
||||
return [
|
||||
const packages = [
|
||||
{
|
||||
code: BreakfastPackageEnum.ANCILLARY_REGULAR_BREAKFAST,
|
||||
quantity: breakfastData.nrOfAdults,
|
||||
@@ -243,6 +243,8 @@ export default function AddAncillaryFlowModal({
|
||||
comment: data.optionalText || undefined,
|
||||
},
|
||||
]
|
||||
|
||||
return packages.filter((pkg) => pkg.quantity > 0)
|
||||
}
|
||||
|
||||
const onSubmit = (data: AncillaryFormData) => {
|
||||
@@ -266,6 +268,7 @@ export default function AddAncillaryFlowModal({
|
||||
formData: data,
|
||||
selectedAncillary,
|
||||
packages: packagesToAdd,
|
||||
isBreakfast,
|
||||
})
|
||||
const shouldSkipGuarantee =
|
||||
booking.guaranteeInfo || (data.quantityWithCard ?? 0) <= 0
|
||||
|
||||
Reference in New Issue
Block a user