fix: unbreak toApiLang call that failed everytime

This commit is contained in:
Simon Emanuelsson
2025-04-03 09:16:15 +02:00
committed by Michael Zetterberg
parent 30c7eb07fa
commit 6d869ceba7
7 changed files with 23 additions and 20 deletions

View File

@@ -483,20 +483,18 @@ export const bookingMutationRouter = router({
update: safeProtectedServiceProcedure
.input(updateBookingInput)
.mutation(async function ({ ctx, input }) {
const accessToken = ctx.serviceToken
const accessToken = ctx.session?.token.access_token || ctx.serviceToken
const { confirmationNumber, ...body } = input
updateBookingCounter.add(1, { confirmationNumber })
const headers = {
Authorization: `Bearer ${accessToken}`,
}
const apiResponse = await api.put(
api.endpoints.v1.Booking.booking(confirmationNumber),
{
headers,
body: body,
body,
headers: {
Authorization: `Bearer ${accessToken}`,
},
}
)