Merged in fix/LOY-206-add-missing-lang-input-transactions-query (pull request #1623)
fix(LOY-206): add missing lang input to friends transactions query, handles both server and client side Approved-by: Michael Zetterberg Approved-by: Chuma Mcphoy (We Ahead)
This commit is contained in:
@@ -6,7 +6,7 @@ import { badRequestError } from "@/server/errors/trpc"
|
||||
import {
|
||||
contentStackBaseWithServiceProcedure,
|
||||
protectedProcedure,
|
||||
protectedServcieProcedure,
|
||||
protectedServiceProcedure,
|
||||
publicProcedure,
|
||||
router,
|
||||
safeProtectedServiceProcedure,
|
||||
@@ -793,7 +793,7 @@ export const getRoomAvailability = async (
|
||||
breakfastIncluded: !!rateDefinition?.breakfastIncluded,
|
||||
cancellationRule: rateDefinition?.cancellationRule,
|
||||
cancellationText: rateDefinition?.cancellationText ?? "",
|
||||
chequeRate: rates?.bonusCheque,
|
||||
chequeRate: rates?.bonusCheque,
|
||||
isFlexRate:
|
||||
rateDefinition?.cancellationRule ===
|
||||
CancellationRuleEnum.CancellableBefore6PM,
|
||||
@@ -812,7 +812,7 @@ export const getRoomAvailability = async (
|
||||
: undefined,
|
||||
rateType: rateDefinition?.rateType ?? "",
|
||||
selectedRoom,
|
||||
voucherRate: rates?.voucher,
|
||||
voucherRate: rates?.voucher,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -862,7 +862,7 @@ export const hotelQueryRouter = router({
|
||||
.query(async ({ input, ctx }) => {
|
||||
return getRoomAvailability(input, ctx.lang, ctx.serviceToken)
|
||||
}),
|
||||
roomWithRedemption: protectedServcieProcedure
|
||||
roomWithRedemption: protectedServiceProcedure
|
||||
.input(selectedRoomAvailabilityInputSchema)
|
||||
.query(async ({ input, ctx }) => {
|
||||
return getRoomAvailability(
|
||||
|
||||
@@ -23,6 +23,7 @@ export const friendTransactionsInput = z
|
||||
.object({
|
||||
limit: z.number().int().positive(),
|
||||
page: z.number().int().positive(),
|
||||
lang: z.nativeEnum(Lang).optional(),
|
||||
})
|
||||
.default({ limit: 5, page: 1 })
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ import { countries } from "@/constants/countries"
|
||||
import * as api from "@/lib/api"
|
||||
import { dt } from "@/lib/dt"
|
||||
import {
|
||||
languageProtectedProcedure,
|
||||
protectedProcedure,
|
||||
router,
|
||||
safeProtectedProcedure,
|
||||
@@ -629,10 +630,11 @@ export const userQueryRouter = router({
|
||||
}),
|
||||
}),
|
||||
transaction: router({
|
||||
friendTransactions: protectedProcedure
|
||||
friendTransactions: languageProtectedProcedure
|
||||
.input(friendTransactionsInput)
|
||||
.query(async ({ ctx, input }) => {
|
||||
const { limit, page } = input
|
||||
|
||||
getFriendTransactionsCounter.add(1)
|
||||
console.info(
|
||||
"api.transaction.friendTransactions start",
|
||||
@@ -699,6 +701,7 @@ export const userQueryRouter = router({
|
||||
"api.transaction.friendTransactions success",
|
||||
JSON.stringify({})
|
||||
)
|
||||
|
||||
const updatedData = await updateStaysBookingUrl(
|
||||
verifiedData.data.data,
|
||||
ctx.session.token.access_token,
|
||||
|
||||
Reference in New Issue
Block a user