feat(SW-2622): pass language to guarantee booking
This commit is contained in:
@@ -7,6 +7,7 @@ import {
|
||||
safeProtectedServiceProcedure,
|
||||
serviceProcedure,
|
||||
} from "@/server/trpc"
|
||||
import { toApiLang } from "@/server/utils"
|
||||
|
||||
import { getBookedHotelRoom } from "@/utils/booking"
|
||||
|
||||
@@ -207,8 +208,10 @@ export const bookingQueryRouter = router({
|
||||
status: serviceProcedure
|
||||
.input(getBookingStatusInput)
|
||||
.concat(refIdPlugin.toConfirmationNumber)
|
||||
.query(async function ({ ctx }) {
|
||||
.query(async function ({ ctx, input }) {
|
||||
const lang = input.lang ?? ctx.lang
|
||||
const { confirmationNumber } = ctx
|
||||
const language = toApiLang(lang)
|
||||
|
||||
const getBookingStatusCounter = createCounter("trpc.booking", "status")
|
||||
const metricsGetBookingStatus = getBookingStatusCounter.init({
|
||||
@@ -223,6 +226,9 @@ export const bookingQueryRouter = router({
|
||||
headers: {
|
||||
Authorization: `Bearer ${ctx.serviceToken}`,
|
||||
},
|
||||
},
|
||||
{
|
||||
language,
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user