refactor: url management in hotel reservation flow
This commit is contained in:
@@ -5,9 +5,9 @@ import { useEffect } from "react"
|
||||
|
||||
import { detailsStorageName } from "@/stores/enter-details"
|
||||
|
||||
import { createQueryParamsForEnterDetails } from "@/components/HotelReservation/SelectRate/RoomSelection/utils"
|
||||
import LoadingSpinner from "@/components/LoadingSpinner"
|
||||
import { trackPaymentEvent } from "@/utils/tracking"
|
||||
import { convertObjToSearchParams } from "@/utils/url"
|
||||
|
||||
import type { PersistedState } from "@/types/stores/enter-details"
|
||||
|
||||
@@ -29,7 +29,7 @@ export default function PaymentCallback({
|
||||
|
||||
if (bookingData) {
|
||||
const detailsStorage: PersistedState = JSON.parse(bookingData)
|
||||
const searchParams = createQueryParamsForEnterDetails(
|
||||
const searchParams = convertObjToSearchParams(
|
||||
detailsStorage.booking,
|
||||
searchObject
|
||||
)
|
||||
@@ -37,13 +37,13 @@ export default function PaymentCallback({
|
||||
if (status === "cancel") {
|
||||
trackPaymentEvent({
|
||||
event: "paymentCancel",
|
||||
hotelId: detailsStorage.booking.hotel,
|
||||
hotelId: detailsStorage.booking.hotelId,
|
||||
})
|
||||
}
|
||||
if (status === "error") {
|
||||
trackPaymentEvent({
|
||||
event: "paymentFail",
|
||||
hotelId: detailsStorage.booking.hotel,
|
||||
hotelId: detailsStorage.booking.hotelId,
|
||||
errorMessage,
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user