refactor: url management in hotel reservation flow
This commit is contained in:
@@ -8,15 +8,13 @@ import { arrayMerge } from "@/utils/merge"
|
||||
|
||||
import { detailsStorageName } from "."
|
||||
|
||||
import type { BookingData } from "@/types/components/hotelReservation/enterDetails/bookingData"
|
||||
import type { SelectRateSearchParams } from "@/types/components/hotelReservation/selectRate/selectRate"
|
||||
import { CurrencyEnum } from "@/types/enums/currency"
|
||||
import type { StepEnum } from "@/types/enums/step"
|
||||
import type {
|
||||
DetailsState,
|
||||
PersistedState,
|
||||
PersistedStatePart,
|
||||
Price,
|
||||
RoomPrice,
|
||||
RoomRate,
|
||||
} from "@/types/stores/enter-details"
|
||||
import type { SafeUser } from "@/types/user"
|
||||
@@ -55,7 +53,10 @@ export function navigate(step: StepEnum, searchParams: string) {
|
||||
window.history.pushState({ step }, "", `${step}?${searchParams}`)
|
||||
}
|
||||
|
||||
export function checkIsSameRoom(prev: BookingData, next: BookingData) {
|
||||
export function checkIsSameRoom(
|
||||
prev: SelectRateSearchParams,
|
||||
next: SelectRateSearchParams
|
||||
) {
|
||||
const { rooms: prevRooms, ...prevBooking } = prev
|
||||
|
||||
const prevRoomsWithoutRateCodes = prevRooms.map(
|
||||
|
||||
@@ -29,7 +29,7 @@ jest.mock("@/lib/api", () => ({
|
||||
}))
|
||||
|
||||
const booking = {
|
||||
hotel: "123",
|
||||
hotelId: "123",
|
||||
fromDate: "2100-01-01",
|
||||
toDate: "2100-01-02",
|
||||
rooms: [
|
||||
|
||||
Reference in New Issue
Block a user