chore: move toApiLang util to hotel trpc folder

This commit is contained in:
Chuma McPhoy
2024-07-04 15:05:02 +02:00
parent 74993f6c3c
commit f89d17cd7f
3 changed files with 27 additions and 3 deletions

View File

@@ -5,6 +5,7 @@ import { publicProcedure, router } from "@/server/trpc"
import { getHotelInputSchema } from "./input"
import { getHotelDataSchema } from "./output"
import tempHotelData from "./tempHotelData.json"
import { toApiLang } from "./utils"
export const hotelQueryRouter = router({
getHotel: publicProcedure
@@ -13,8 +14,9 @@ export const hotelQueryRouter = router({
const { hotelId, language } = input
const params = new URLSearchParams()
const apiLang = toApiLang(language)
params.set("hotelId", hotelId.toString())
params.set("language", language.toString())
params.set("language", apiLang)
// TODO: Enable once we have authorized API access.
// const apiResponse = await api.get(