Fixes bookingwidget skeleton and memoize fetching of creditcards
This commit is contained in:
@@ -245,7 +245,7 @@ export function SearchSkeleton() {
|
|||||||
</Caption>
|
</Caption>
|
||||||
</div>
|
</div>
|
||||||
<div className={styles.input}>
|
<div className={styles.input}>
|
||||||
<SkeletonShimmer />
|
<SkeletonShimmer width={"100%"} />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -104,13 +104,13 @@ export function BookingWidgetFormContentSkeleton() {
|
|||||||
<Caption color="red" type="bold">
|
<Caption color="red" type="bold">
|
||||||
{intl.formatMessage({ id: "booking.nights" }, { totalNights: 0 })}
|
{intl.formatMessage({ id: "booking.nights" }, { totalNights: 0 })}
|
||||||
</Caption>
|
</Caption>
|
||||||
<SkeletonShimmer />
|
<SkeletonShimmer width={"100%"} />
|
||||||
</div>
|
</div>
|
||||||
<div className={styles.rooms}>
|
<div className={styles.rooms}>
|
||||||
<Caption color="red" type="bold" asChild>
|
<Caption color="red" type="bold" asChild>
|
||||||
<span>{intl.formatMessage({ id: "Guests & Rooms" })}</span>
|
<span>{intl.formatMessage({ id: "Guests & Rooms" })}</span>
|
||||||
</Caption>
|
</Caption>
|
||||||
<SkeletonShimmer />
|
<SkeletonShimmer width={"100%"} />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className={styles.voucherContainer}>
|
<div className={styles.voucherContainer}>
|
||||||
|
|||||||
@@ -214,13 +214,14 @@ export function parsedUser(data: User, isMFA: boolean) {
|
|||||||
return user
|
return user
|
||||||
}
|
}
|
||||||
|
|
||||||
async function getCreditCards({
|
const getCreditCards = cache(
|
||||||
|
async ({
|
||||||
session,
|
session,
|
||||||
onlyNonExpired,
|
onlyNonExpired,
|
||||||
}: {
|
}: {
|
||||||
session: Session
|
session: Session
|
||||||
onlyNonExpired?: boolean
|
onlyNonExpired?: boolean
|
||||||
}) {
|
}) => {
|
||||||
getCreditCardsCounter.add(1)
|
getCreditCardsCounter.add(1)
|
||||||
console.info("api.profile.creditCards start", JSON.stringify({}))
|
console.info("api.profile.creditCards start", JSON.stringify({}))
|
||||||
const apiResponse = await api.get(api.endpoints.v1.Profile.creditCards, {
|
const apiResponse = await api.get(api.endpoints.v1.Profile.creditCards, {
|
||||||
@@ -281,6 +282,7 @@ async function getCreditCards({
|
|||||||
return true
|
return true
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
)
|
||||||
|
|
||||||
export const userQueryRouter = router({
|
export const userQueryRouter = router({
|
||||||
get: protectedProcedure
|
get: protectedProcedure
|
||||||
|
|||||||
Reference in New Issue
Block a user