Merged in fix/optional-chaining-lint-issue (pull request #2905)

* remove optional chaining with force unrwap


Approved-by: Bianca Widstam
This commit is contained in:
Joakim Jäderberg
2025-10-03 12:50:30 +00:00
parent bec3188199
commit 5bf18f0412

View File

@@ -31,18 +31,20 @@ export function RoomsContainer({}: RoomsContainerProps) {
} = useSelectRateContext()
useEffect(() => {
if (availabilityData) {
const lowestRoomPrice = getLowestRoomPrice()
const booking = inputData?.booking!
if (!availabilityData) return
trackLowestRoomPrice({
hotelId: booking.hotelId,
arrivalDate: booking?.fromDate,
departureDate: booking?.toDate,
lowestPrice: lowestRoomPrice.price.toString(),
currency: lowestRoomPrice.currency,
})
}
const lowestRoomPrice = getLowestRoomPrice()
const booking = inputData?.booking
if (!booking) return
trackLowestRoomPrice({
hotelId: booking.hotelId,
arrivalDate: booking?.fromDate,
departureDate: booking?.toDate,
lowestPrice: lowestRoomPrice.price.toString(),
currency: lowestRoomPrice.currency,
})
}, [availabilityData, inputData, getLowestRoomPrice])
if (isFetching) {