diff --git a/apps/scandic-web/middlewares/dateQueryParams.ts b/apps/scandic-web/middlewares/dateQueryParams.ts index 4cb97bcb2..eff00fd60 100644 --- a/apps/scandic-web/middlewares/dateQueryParams.ts +++ b/apps/scandic-web/middlewares/dateQueryParams.ts @@ -1,9 +1,11 @@ import { type NextMiddleware, NextResponse } from "next/server" +import { getPublicNextURL } from "@/server/utils" + import type { MiddlewareMatcher } from "@/types/middleware" export const middleware: NextMiddleware = (request) => { - const url = request.nextUrl.clone() + const url = new URL(request.nextUrl, getPublicNextURL(request)) const { searchParams } = url let modified = false diff --git a/apps/scandic-web/server/routers/hotels/utils.ts b/apps/scandic-web/server/routers/hotels/utils.ts index 8d3ddf0e3..2ca8bd260 100644 --- a/apps/scandic-web/server/routers/hotels/utils.ts +++ b/apps/scandic-web/server/routers/hotels/utils.ts @@ -13,6 +13,7 @@ import { toApiLang } from "@/server/utils" import { generateChildrenString } from "@/components/HotelReservation/utils" import { getCacheClient } from "@/services/dataCache" import { cache } from "@/utils/cache" +import { chunk } from "@/utils/chunk" import { sortRoomConfigs } from "@/utils/sort" import { getHotelPageUrls } from "../contentstack/hotelPage/utils" @@ -31,6 +32,8 @@ import { roomsAvailabilitySchema, } from "./output" +import type { z } from "zod" + import type { BedTypeSelection } from "@/types/components/hotelReservation/enterDetails/bedType" import { AvailabilityEnum } from "@/types/components/hotelReservation/selectHotel/selectHotel" import { RoomPackageCodeEnum } from "@/types/components/hotelReservation/selectRate/roomFilter" @@ -61,8 +64,6 @@ import type { RoomConfiguration, } from "@/types/trpc/routers/hotel/roomAvailability" import type { Endpoint } from "@/lib/api/endpoints" -import { chunk } from "@/utils/chunk" -import { z } from "zod" export function getPoiGroupByCategoryName(category: string | undefined) { if (!category) return PointOfInterestGroupEnum.LOCATION