Merged in fix/BOOK-131-noroomsavailability-tracking (pull request #2971)
fix(BOOK-131): add action and domain * fix(BOOK-131): add action and domain Approved-by: Anton Gunnarsson
This commit is contained in:
@@ -4,6 +4,7 @@ import { usePathname, useSearchParams } from "next/navigation"
|
||||
import { useCallback, useEffect } from "react"
|
||||
import { useIntl } from "react-intl"
|
||||
|
||||
import { useSessionId } from "@scandic-hotels/common/hooks/useSessionId"
|
||||
import { toast } from "@scandic-hotels/design-system/Toast"
|
||||
import { trackNoAvailability } from "@scandic-hotels/tracking/NoAvailabilityTracking"
|
||||
import { BookingErrorCodeEnum } from "@scandic-hotels/trpc/enums/bookingErrorCode"
|
||||
@@ -21,6 +22,8 @@ export default function AvailabilityError({ booking }: AvailabilityErrorProps) {
|
||||
const intl = useIntl()
|
||||
const pathname = usePathname()
|
||||
const searchParams = useSearchParams()
|
||||
const sessionId = useSessionId()
|
||||
|
||||
const lang = useLang()
|
||||
|
||||
const { rooms, fromDate, toDate, hotelId, bookingCode, searchType } = booking
|
||||
@@ -61,8 +64,19 @@ export default function AvailabilityError({ booking }: AvailabilityErrorProps) {
|
||||
pageName: "hotelreservation|select-rate",
|
||||
pageType: "bookingroomsandratespage",
|
||||
siteSections: "hotelreservation|select-rate",
|
||||
sessionId,
|
||||
domain: typeof window !== "undefined" ? window.location.host : "",
|
||||
})
|
||||
}, [rooms, hotelId, lang, fromDate, toDate, searchType, bookingCode])
|
||||
}, [
|
||||
rooms,
|
||||
hotelId,
|
||||
lang,
|
||||
fromDate,
|
||||
toDate,
|
||||
searchType,
|
||||
bookingCode,
|
||||
sessionId,
|
||||
])
|
||||
|
||||
useEffect(() => {
|
||||
if (hasAvailabilityError) {
|
||||
|
||||
Reference in New Issue
Block a user