feat: SW-2028 Updated validations at trpc query level
This commit is contained in:
@@ -44,7 +44,6 @@ function HotelCard({
|
||||
state = "default",
|
||||
type = HotelCardListingTypeEnum.PageListing,
|
||||
bookingCode = "",
|
||||
userPoints,
|
||||
}: HotelCardProps) {
|
||||
const params = useParams()
|
||||
const lang = params.lang as Lang
|
||||
@@ -74,13 +73,7 @@ function HotelCard({
|
||||
availability.productType?.member?.rateType === RateTypeEnum.Regular
|
||||
const price = availability.productType
|
||||
|
||||
const userHasEnoughPoints =
|
||||
userPoints !== undefined
|
||||
? !!price?.redemptions?.some(
|
||||
(r) => r.localPrice.pointsPerStay < userPoints
|
||||
)
|
||||
: false
|
||||
|
||||
const userHasEnoughPoints = price?.redemptions?.some((r) => r.hasEnoughPoints)
|
||||
const notEnoughPointsLabel = intl.formatMessage({ id: "Not enough points" })
|
||||
|
||||
return (
|
||||
@@ -218,7 +211,7 @@ function HotelCard({
|
||||
))}
|
||||
</div>
|
||||
) : null}
|
||||
{userPoints !== undefined && !userHasEnoughPoints ? (
|
||||
{price?.redemptions?.length && !userHasEnoughPoints ? (
|
||||
<Tooltip
|
||||
arrow="left"
|
||||
position="bottom"
|
||||
|
||||
Reference in New Issue
Block a user