feat: SW-2028 Updated validations at trpc query level
This commit is contained in:
@@ -246,14 +246,6 @@ export async function getHotels(
|
||||
return hotels
|
||||
}
|
||||
|
||||
export async function getUserPoints() {
|
||||
const membershipCard = await serverClient().user.safeMembershipLevel()
|
||||
if (!membershipCard) {
|
||||
return undefined
|
||||
}
|
||||
return membershipCard.currentPoints
|
||||
}
|
||||
|
||||
const hotelSurroundingsFilterNames = [
|
||||
"Hotel surroundings",
|
||||
"Hotel omgivelser",
|
||||
|
||||
@@ -23,7 +23,7 @@ import { convertObjToSearchParams } from "@/utils/url"
|
||||
|
||||
import HotelCardListing from "../HotelCardListing"
|
||||
import BookingCodeFilter from "./BookingCodeFilter"
|
||||
import { getFiltersFromHotels, getHotels, getUserPoints } from "./helpers"
|
||||
import { getFiltersFromHotels, getHotels } from "./helpers"
|
||||
import HotelCount from "./HotelCount"
|
||||
import HotelFilter from "./HotelFilter"
|
||||
import HotelSorter from "./HotelSorter"
|
||||
@@ -76,11 +76,6 @@ export default async function SelectHotel({
|
||||
!!redemption
|
||||
)
|
||||
|
||||
let userPoints
|
||||
if (redemption) {
|
||||
userPoints = await getUserPoints()
|
||||
}
|
||||
|
||||
const arrivalDate = new Date(selectHotelParams.fromDate)
|
||||
const departureDate = new Date(selectHotelParams.toDate)
|
||||
|
||||
@@ -252,10 +247,7 @@ export default async function SelectHotel({
|
||||
isAllUnavailable={isAllUnavailable}
|
||||
operaId={hotels?.[0]?.hotel.operaId}
|
||||
/>
|
||||
<HotelCardListing
|
||||
hotelData={hotels}
|
||||
userPoints={userPoints ? userPoints : undefined}
|
||||
/>
|
||||
<HotelCardListing hotelData={hotels} />
|
||||
</div>
|
||||
</main>
|
||||
<Suspense key={`${suspenseKey}-tracking`} fallback={null}>
|
||||
|
||||
Reference in New Issue
Block a user