Merged in feat/SW-913-disable-booking-widget-from-alert (pull request #930)
feat(SW-913): Hide bookingwidget from cms Approved-by: Christel Westerberg
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { getLocations } from "@/lib/trpc/memoizedRequests"
|
||||
import { getLocations, getSiteConfig } from "@/lib/trpc/memoizedRequests"
|
||||
|
||||
import BookingWidgetClient from "./Client"
|
||||
|
||||
@@ -13,8 +13,9 @@ export default async function BookingWidget({
|
||||
searchParams,
|
||||
}: BookingWidgetProps) {
|
||||
const locations = await getLocations()
|
||||
const siteConfig = await getSiteConfig()
|
||||
|
||||
if (!locations || "error" in locations) {
|
||||
if (!locations || "error" in locations || siteConfig?.bookingWidgetDisabled) {
|
||||
return null
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user