Merged in chore/upgrade-next (pull request #3124)
Upgrade next@15.5.6 * chore: upgrade next@15.5.6 * chore: upgrade turborepo@2.6.1 * fix typings for scandic-web * fix: set correct type for pages * cleanup * fix more route.ts typing issues * Merge branch 'master' of bitbucket.org:scandic-swap/web into chore/upgrade-next * explicitly import the types Approved-by: Linus Flood
This commit is contained in:
@@ -6,33 +6,29 @@ import { myStay } from "@/constants/routes/webviews"
|
||||
|
||||
import GuaranteeCallbackPage from "@/components/GuaranteeCallback"
|
||||
|
||||
import type { Lang } from "@scandic-hotels/common/constants/language"
|
||||
import type { PaymentCallbackStatusEnum } from "@scandic-hotels/common/constants/paymentCallbackStatusEnum"
|
||||
|
||||
import type { LangParams, PageArgs } from "@/types/params"
|
||||
|
||||
export default async function GuaranteePaymentWebViewCallbackPage(
|
||||
props: PageArgs<
|
||||
LangParams,
|
||||
{
|
||||
status?: PaymentCallbackStatusEnum
|
||||
RefId?: string
|
||||
confirmationNumber?: string
|
||||
ancillary?: string
|
||||
}
|
||||
>
|
||||
props: PageProps<"/[lang]/webview/hotelreservation/gla-payment-callback">
|
||||
) {
|
||||
const searchParams = await props.searchParams
|
||||
const params = await props.params
|
||||
logger.debug(`[gla-payment-callback] callback started`)
|
||||
const lang = params.lang
|
||||
const status = searchParams.status
|
||||
const confirmationNumber = searchParams.confirmationNumber
|
||||
const refId = searchParams.RefId
|
||||
const lang = params.lang as Lang
|
||||
const status = searchParams.status as PaymentCallbackStatusEnum
|
||||
const confirmationNumber =
|
||||
typeof searchParams.confirmationNumber === "string"
|
||||
? searchParams.confirmationNumber
|
||||
: undefined
|
||||
const refId =
|
||||
typeof searchParams.RefId === "string" ? searchParams.RefId : undefined
|
||||
|
||||
if (!status || !confirmationNumber || !refId) {
|
||||
notFound()
|
||||
}
|
||||
const myStayUrl = `${myStay[lang]}?RefId=${encodeURIComponent(refId)}`
|
||||
|
||||
logger.debug(`[gla-payment-callback] callback started`)
|
||||
return (
|
||||
<GuaranteeCallbackPage
|
||||
status={status}
|
||||
|
||||
Reference in New Issue
Block a user