Merged in feat/sw-2879-booking-widget-to-booking-flow-package (pull request #2532)
feat(SW-2879): Move BookingWidget to booking-flow package * Fix lockfile * Fix styling * a tiny little booking widget test * Tiny fixes * Merge branch 'master' into feat/sw-2879-booking-widget-to-booking-flow-package * Remove unused scripts * lint:fix * Merge branch 'master' into feat/sw-2879-booking-widget-to-booking-flow-package * Tiny lint fixes * update test * Update Input in booking-flow * Clean up comments etc * Merge branch 'master' into feat/sw-2879-booking-widget-to-booking-flow-package * Setup tracking context for booking-flow * Add missing use client * Fix temp tracking function * Pass booking to booking-widget * Remove comment * Add use client to booking widget tracking provider * Add use client to tracking functions * Merge branch 'master' into feat/sw-2879-booking-widget-to-booking-flow-package * Move debug page * Merge branch 'master' into feat/sw-2879-booking-widget-to-booking-flow-package * Merge branch 'master' into feat/sw-2879-booking-widget-to-booking-flow-package * Merge branch 'master' into feat/sw-2879-booking-widget-to-booking-flow-package Approved-by: Bianca Widstam
This commit is contained in:
@@ -2,7 +2,6 @@ import { redirect } from "next/navigation"
|
||||
|
||||
import { isDefined } from "@scandic-hotels/common/utils/isDefined"
|
||||
|
||||
// import { isDefined } from "@/server/utils"
|
||||
import { getLang } from "@/i18n/serverContext"
|
||||
import { cache } from "@/utils/cache"
|
||||
|
||||
@@ -290,37 +289,6 @@ export const getPageSettings = cache(async function getMemoizedPageSettings(
|
||||
return caller.contentstack.pageSettings.get({ lang })
|
||||
})
|
||||
|
||||
export const isBookingWidgetHidden = cache(
|
||||
async function isMemoizedBookingWidgetHidden() {
|
||||
const lang = await getLang()
|
||||
const [pageSettingsResult, siteConfigResults] = await Promise.allSettled([
|
||||
getPageSettings(lang),
|
||||
getSiteConfig(lang),
|
||||
])
|
||||
|
||||
const pageSettings =
|
||||
pageSettingsResult.status === "fulfilled"
|
||||
? pageSettingsResult.value
|
||||
: null
|
||||
const siteConfig =
|
||||
siteConfigResults.status === "fulfilled" ? siteConfigResults.value : null
|
||||
|
||||
const hideFromPageSettings =
|
||||
pageSettings?.page.settings.hide_booking_widget ?? false
|
||||
const hideFromSiteConfig = siteConfig?.bookingWidgetDisabled ?? false
|
||||
|
||||
return hideFromPageSettings || hideFromSiteConfig
|
||||
}
|
||||
)
|
||||
|
||||
export const getPageSettingsBookingCode = cache(
|
||||
async function getMemoizedPageSettingsBookingCode() {
|
||||
const lang = await getLang()
|
||||
const pageSettings = await getPageSettings(lang)
|
||||
return pageSettings?.page.settings.booking_code ?? ""
|
||||
}
|
||||
)
|
||||
|
||||
export const getJobylonFeed = cache(async function getMemoizedJobylonFeed() {
|
||||
const caller = await serverClient()
|
||||
return caller.partner.jobylon.feed.get()
|
||||
|
||||
Reference in New Issue
Block a user