Merged in fix/SW-1754-overview-page-rate-limit (pull request #1412)
fix(SW-1754): Fix rate limit issue on Destination Overview Page * fix(SW-1754): Fix rate limit issue on Destination Overview Page Approved-by: Matilda Landström
This commit is contained in:
@@ -17,7 +17,7 @@ import { toApiLang } from "@/server/utils"
|
||||
import { generateChildrenString } from "@/components/HotelReservation/utils"
|
||||
import { cache } from "@/utils/cache"
|
||||
|
||||
import { getHotelPageUrl } from "../contentstack/hotelPage/utils"
|
||||
import { getHotelPageUrls } from "../contentstack/hotelPage/utils"
|
||||
import { getVerifiedUser, parsedUser } from "../user/query"
|
||||
import { additionalDataSchema } from "./schemas/hotel/include/additionalData"
|
||||
import { meetingRoomsSchema } from "./schemas/meetingRoom"
|
||||
@@ -1100,21 +1100,21 @@ export const hotelQueryRouter = router({
|
||||
)
|
||||
return []
|
||||
}
|
||||
|
||||
const hotelPages = await getHotelPageUrls(language)
|
||||
const hotels = await Promise.all(
|
||||
hotelsToFetch.map(async (hotelId) => {
|
||||
const [hotelData, url] = await Promise.all([
|
||||
getHotel(
|
||||
{ hotelId, isCardOnlyPayment: false, language },
|
||||
ctx.serviceToken
|
||||
),
|
||||
getHotelPageUrl(language, hotelId),
|
||||
])
|
||||
const hotelData = await getHotel(
|
||||
{ hotelId, isCardOnlyPayment: false, language },
|
||||
ctx.serviceToken
|
||||
)
|
||||
const hotelPage = hotelPages.find(
|
||||
(page) => page.hotelId === hotelId
|
||||
)
|
||||
|
||||
return hotelData
|
||||
? {
|
||||
...hotelData,
|
||||
url,
|
||||
url: hotelPage?.url ?? null,
|
||||
}
|
||||
: null
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user