fix: move date logic to its own file with tests

fix: missing packages should not prevent render
fix: display nothing if roomavailability returns nothing
This commit is contained in:
Joakim Jäderberg
2024-11-22 10:29:59 +01:00
parent 10bd915217
commit 079ad45ded
2 changed files with 17 additions and 18 deletions

View File

@@ -73,16 +73,19 @@ export async function RoomsContainer({
await roomsAvailabilityPromise
if (packagesError) {
console.error("packagesError", packagesError)
return (
<div>Unable to get packages. {JSON.stringify({ ...packagesError })}</div>
)
// TODO: Log packages error
console.error("[RoomsContainer] unable to fetch packages")
}
if (roomsAvailabilityError || !roomsAvailability) {
console.error("roomsAvailabilityError", roomsAvailabilityError)
return <div>Unable to get room availability</div>
if (roomsAvailabilityError) {
// TODO: show proper error component
console.error("[RoomsContainer] unable to fetch room availability")
return null
}
if (!roomsAvailability) {
// HotelInfoCard has the logic for displaying when there are no rooms available
return null
}
return (