Merged in feat/LOY-421-Next-Stay (pull request #3026)
Feat(LOY-421): Next Stay * feat(LOY-421): Next stay WIP * fix(LOY-421): clean upp css and jsx * chore(LOY-421): css cleanup * fix(LOY-421): fix test * only show button if isWebAppOrigin is true * chore(LOY-421): update section header component * chore(LOY-421): remove redundant test case Approved-by: Matilda Landström
This commit is contained in:
@@ -183,6 +183,26 @@ export const userQueryRouter = router({
|
||||
}
|
||||
return null
|
||||
}),
|
||||
|
||||
next: languageProtectedProcedure.query(async ({ ctx }) => {
|
||||
const data = await getUpcomingStays(
|
||||
ctx.session.token.access_token,
|
||||
1, // Only get the closest stay
|
||||
ctx.lang
|
||||
)
|
||||
|
||||
if (data && data.data.length > 0) {
|
||||
const updatedData = await updateStaysBookingUrl(
|
||||
data.data,
|
||||
ctx.session,
|
||||
ctx.lang
|
||||
)
|
||||
|
||||
// Return only the first (closest) stay
|
||||
return updatedData[0]
|
||||
}
|
||||
return null
|
||||
}),
|
||||
}),
|
||||
transaction: router({
|
||||
friendTransactions: languageProtectedProcedure
|
||||
|
||||
@@ -14,6 +14,7 @@ export namespace DynamicContentEnum {
|
||||
my_pages_overview_shortcuts: "my_pages_overview_shortcuts",
|
||||
my_points: "my_points",
|
||||
next_benefits: "next_benefits",
|
||||
next_stay: "next_stay",
|
||||
overview_table: "overview_table",
|
||||
points_overview: "points_overview",
|
||||
previous_stays: "previous_stays",
|
||||
|
||||
Reference in New Issue
Block a user