fix: add wrapper function for caching

This commit is contained in:
Christel Westerberg
2024-11-25 13:47:25 +01:00
parent 503b0bf186
commit 8bfc4065ed
7 changed files with 55 additions and 53 deletions

View File

@@ -1,16 +1,11 @@
import { metrics } from "@opentelemetry/api"
import { cache } from "react"
import { Lang } from "@/constants/languages"
import * as api from "@/lib/api"
import { dt } from "@/lib/dt"
import { GetHotelPage } from "@/lib/graphql/Query/HotelPage/HotelPage.graphql"
import { request } from "@/lib/graphql/request"
import {
badRequestError,
notFound,
serverErrorByStatus,
} from "@/server/errors/trpc"
import { badRequestError, notFound } from "@/server/errors/trpc"
import {
contentStackUidWithServiceProcedure,
publicProcedure,
@@ -20,6 +15,8 @@ import {
} from "@/server/trpc"
import { toApiLang } from "@/server/utils"
import { cache } from "@/utils/cache"
import { hotelPageSchema } from "../contentstack/hotelPage/output"
import {
fetchHotelPageRefs,
@@ -57,7 +54,6 @@ import {
import { FacilityCardTypeEnum } from "@/types/components/hotelPage/facilities"
import type { BedTypeSelection } from "@/types/components/hotelReservation/enterDetails/bedType"
import { AvailabilityEnum } from "@/types/components/hotelReservation/selectHotel/selectHotel"
import { BreakfastPackageEnum } from "@/types/enums/breakfast"
import { HotelTypeEnum } from "@/types/enums/hotelType"
import type { RequestOptionsWithOutBody } from "@/types/fetch"