feat(SW-2116): avoid passing entire booking object to Room client component
This commit is contained in:
committed by
Michael Zetterberg
parent
a839d05e09
commit
7eeb0bbcac
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user