feat(697): Made new fields optional

This commit is contained in:
Pontus Dreij
2024-11-04 16:09:31 +01:00
parent 83c1178ba5
commit 04df824ea1
7 changed files with 29 additions and 22 deletions

View File

@@ -1095,8 +1095,11 @@ export const hotelQueryRouter = router({
const freeBreakfastPackage = breakfastPackages.data.find(
(pkg) => pkg.code === BreakfastPackageEnum.FREE_MEMBER_BREAKFAST
)
if (freeBreakfastPackage) {
if (originalBreakfastPackage) {
if (freeBreakfastPackage && freeBreakfastPackage.localPrice) {
if (
originalBreakfastPackage &&
originalBreakfastPackage.localPrice
) {
freeBreakfastPackage.localPrice.price =
originalBreakfastPackage.localPrice.price
}