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:
@@ -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 (
|
||||
|
||||
Reference in New Issue
Block a user