feat(SW-1710): add access checks to my stay page for viewing booking

This commit is contained in:
Christian Andolf
2025-03-05 13:46:09 +01:00
parent 1009ea87c9
commit b0df70e552
21 changed files with 515 additions and 133 deletions

View File

@@ -10,7 +10,7 @@ import {
} from "@/server/trpc"
import { getHotel } from "../hotels/query"
import encryptValue from "../utils/encryptValue"
import { encrypt } from "../utils/encryption"
import {
bookingConfirmationInput,
createRefIdInput,
@@ -241,8 +241,8 @@ export const bookingQueryRouter = router({
createRefId: serviceProcedure
.input(createRefIdInput)
.mutation(async function ({ input }) {
const { bookingNumber, lastName } = input
const encryptedRefId = encryptValue(`${bookingNumber},${lastName}`)
const { confirmationNumber, lastName } = input
const encryptedRefId = encrypt(`${confirmationNumber},${lastName}`)
if (!encryptedRefId) {
throw serverErrorByStatus(422, "Was not able to encrypt ref id")