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:
committed by
Michael Zetterberg
parent
35a2ae9dcc
commit
e0fe5ff0d5
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user