fix(SW-302): add facility ID enum
This commit is contained in:
@@ -24,3 +24,9 @@ export enum RestaurantHeadings {
|
|||||||
restaurant = "Restaurant",
|
restaurant = "Restaurant",
|
||||||
breakfastRestaurant = "Breakfast restaurant",
|
breakfastRestaurant = "Breakfast restaurant",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export enum FacilityIds {
|
||||||
|
bar = 1606,
|
||||||
|
rooftopBar = 1014,
|
||||||
|
restaurant = 1383,
|
||||||
|
}
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ import {
|
|||||||
type Facilities,
|
type Facilities,
|
||||||
type FacilityCards,
|
type FacilityCards,
|
||||||
FacilityEnum,
|
FacilityEnum,
|
||||||
|
FacilityIds,
|
||||||
RestaurantHeadings,
|
RestaurantHeadings,
|
||||||
} from "@/types/components/hotelPage/facilities"
|
} from "@/types/components/hotelPage/facilities"
|
||||||
import type { ImageVaultAsset } from "@/types/components/imageVault"
|
import type { ImageVaultAsset } from "@/types/components/imageVault"
|
||||||
@@ -141,9 +142,12 @@ export async function setFacilityCards(
|
|||||||
|
|
||||||
export function getRestaurantHeading(amenities: Amenities): RestaurantHeadings {
|
export function getRestaurantHeading(amenities: Amenities): RestaurantHeadings {
|
||||||
const hasBar = amenities.some(
|
const hasBar = amenities.some(
|
||||||
(facility) => facility.id == 1606 || facility.id == 1014 // bar & rooftop bar id
|
(facility) =>
|
||||||
|
facility.id == FacilityIds.bar || facility.id == FacilityIds.rooftopBar
|
||||||
|
)
|
||||||
|
const hasRestaurant = amenities.some(
|
||||||
|
(facility) => facility.id == FacilityIds.restaurant
|
||||||
)
|
)
|
||||||
const hasRestaurant = amenities.some((facility) => facility.id == 1383) // restaurant id
|
|
||||||
|
|
||||||
if (hasBar && hasRestaurant) {
|
if (hasBar && hasRestaurant) {
|
||||||
return RestaurantHeadings.restaurantAndBar
|
return RestaurantHeadings.restaurantAndBar
|
||||||
|
|||||||
Reference in New Issue
Block a user