Merged in fix/BOOK-459-tracking-search (pull request #2984)
fix(BOOK-459): update searchTerm to city or hotelname * fix(BOOK-459): update searchTerm to city or hotelname Approved-by: Erik Tiekstra
This commit is contained in:
@@ -3,7 +3,6 @@
|
||||
import { TrackingSDK } from "@scandic-hotels/tracking/TrackingSDK"
|
||||
|
||||
import { useBookingFlowConfig } from "../../../bookingFlowConfig/bookingFlowConfigContext"
|
||||
import { useSearchHistory } from "../../../hooks/useSearchHistory"
|
||||
import { useEnterDetailsStore } from "../../../stores/enter-details"
|
||||
import { getTracking } from "./tracking"
|
||||
|
||||
@@ -33,8 +32,6 @@ export default function EnterDetailsTrackingWrapper({
|
||||
breakfastPackages: state.breakfastPackages,
|
||||
}))
|
||||
const config = useBookingFlowConfig()
|
||||
const searchHistory = useSearchHistory()
|
||||
const searchTerm = searchHistory.searchHistory[0]?.name
|
||||
|
||||
const { hotelsTrackingData, pageTrackingData, ancillaries } = getTracking(
|
||||
booking,
|
||||
@@ -44,8 +41,7 @@ export default function EnterDetailsTrackingWrapper({
|
||||
lang,
|
||||
storedRooms,
|
||||
breakfastPackages,
|
||||
config,
|
||||
searchTerm
|
||||
config
|
||||
)
|
||||
|
||||
return (
|
||||
|
||||
@@ -36,8 +36,7 @@ export function getTracking(
|
||||
lang: Lang,
|
||||
storedRooms: RoomState[],
|
||||
breakfastPackages: BreakfastPackages,
|
||||
config: Pick<BookingFlowConfig, "bookingCodeEnabled">,
|
||||
searchTerm?: string
|
||||
config: Pick<BookingFlowConfig, "bookingCodeEnabled">
|
||||
) {
|
||||
const arrivalDate = new Date(booking.fromDate)
|
||||
const departureDate = new Date(booking.toDate)
|
||||
@@ -205,7 +204,7 @@ export function getTracking(
|
||||
// @ts-expect-error - redemption object doesn't exist error
|
||||
rooms.find((room) => "redemption" in room.roomRate)?.roomRate.redemption
|
||||
.localPrice.pointsPerStay ?? "n/a",
|
||||
searchTerm,
|
||||
searchTerm: hotel.name,
|
||||
searchType: "hotel",
|
||||
specialRoomType: rooms
|
||||
.map((room) => getSpecialRoomType(room.packages))
|
||||
|
||||
Reference in New Issue
Block a user