fix(SW-2614): send language to API

We were missing the language param on some endpoints. We are still
missing it on some, but I left those without when we don't need it, e.g.
when only caring about the IDs in the response.
This commit is contained in:
Niclas Edenvin
2025-05-06 11:07:04 +02:00
committed by Michael Zetterberg
parent 35a2ae9dcc
commit e0fe5ff0d5
7 changed files with 47 additions and 12 deletions

View File

@@ -7,6 +7,7 @@ import {
safeProtectedServiceProcedure,
serviceProcedure,
} from "@/server/trpc"
import { toApiLang } from "@/server/utils"
import { getBookedHotelRoom } from "@/utils/booking"
@@ -208,11 +209,13 @@ export const bookingQueryRouter = router({
.input(getBookingStatusInput)
.concat(refIdPlugin.toConfirmationNumber)
.query(async function ({ ctx }) {
const { confirmationNumber } = ctx
const { confirmationNumber, lang } = ctx
const language = toApiLang(lang)
const getBookingStatusCounter = createCounter("trpc.booking", "status")
const metricsGetBookingStatus = getBookingStatusCounter.init({
confirmationNumber,
language,
})
metricsGetBookingStatus.start()
@@ -223,7 +226,8 @@ export const bookingQueryRouter = router({
headers: {
Authorization: `Bearer ${ctx.serviceToken}`,
},
}
},
{ language }
)
if (!apiResponse.ok) {