feat(SW-2116): avoid passing entire booking object to Room client component

This commit is contained in:
Arvid Norlin
2025-04-23 15:47:18 +02:00
committed by Michael Zetterberg
parent a839d05e09
commit 7eeb0bbcac
11 changed files with 75 additions and 43 deletions

View File

@@ -7,8 +7,9 @@ import {
serviceProcedure,
} from "@/server/trpc"
import { calculateRefId } from "@/utils/refId"
import { getHotel } from "../hotels/utils"
import { encrypt } from "../utils/encryption"
import {
createRefIdInput,
getBookingInput,
@@ -169,7 +170,7 @@ export const bookingQueryRouter = router({
.input(createRefIdInput)
.mutation(async function ({ input }) {
const { confirmationNumber, lastName } = input
const encryptedRefId = encrypt(`${confirmationNumber},${lastName}`)
const encryptedRefId = calculateRefId(confirmationNumber, lastName)
if (!encryptedRefId) {
throw serverErrorByStatus(422, "Was not able to encrypt ref id")