Merged in hotfix/mystays-show-more (pull request #1698)
hotfix: my stays - pass language to trpc * hotfix: my stays - pass language to trpc Approved-by: Joakim Jäderberg
This commit is contained in:
@@ -16,6 +16,7 @@ export const staysInput = z
|
||||
.min(0)
|
||||
.default(6)
|
||||
.transform((num) => String(num)),
|
||||
lang: z.nativeEnum(Lang).optional(),
|
||||
})
|
||||
.default({})
|
||||
|
||||
|
||||
@@ -452,7 +452,8 @@ export const userQueryRouter = router({
|
||||
previous: protectedProcedure
|
||||
.input(staysInput)
|
||||
.query(async ({ ctx, input }) => {
|
||||
const { limit, cursor } = input
|
||||
const { limit, cursor, lang } = input
|
||||
const language = lang || ctx.lang
|
||||
const params: Record<string, string> = { limit }
|
||||
if (cursor) {
|
||||
params.offset = cursor
|
||||
@@ -533,7 +534,7 @@ export const userQueryRouter = router({
|
||||
const updatedData = await updateStaysBookingUrl(
|
||||
verifiedData.data.data,
|
||||
ctx.session.token.access_token,
|
||||
ctx.lang
|
||||
language
|
||||
)
|
||||
|
||||
return {
|
||||
@@ -545,8 +546,8 @@ export const userQueryRouter = router({
|
||||
upcoming: protectedProcedure
|
||||
.input(staysInput)
|
||||
.query(async ({ ctx, input }) => {
|
||||
const { limit, cursor } = input
|
||||
|
||||
const { limit, cursor, lang } = input
|
||||
const language = lang || ctx.lang
|
||||
const params: Record<string, string> = { limit }
|
||||
if (cursor) {
|
||||
params.offset = cursor
|
||||
@@ -626,7 +627,7 @@ export const userQueryRouter = router({
|
||||
const updatedData = await updateStaysBookingUrl(
|
||||
verifiedData.data.data,
|
||||
ctx.session.token.access_token,
|
||||
ctx.lang
|
||||
language
|
||||
)
|
||||
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user