Merged in fix/booking-flow-eslint-fix (pull request #3342)
fix: Upgrade booking-flow eslint config * Upgrade booking-flow eslint config Approved-by: Bianca Widstam
This commit is contained in:
@@ -38,6 +38,7 @@ export async function BookingConfirmationPage({
|
||||
}
|
||||
|
||||
const expire = Number(decrypt(sig))
|
||||
// eslint-disable-next-line react-hooks/purity
|
||||
const now = Math.floor(Date.now() / 1000)
|
||||
if (typeof expire === "number" && !isNaN(expire) && now > expire) {
|
||||
redirect(`/${lang}`)
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { notFound } from "next/navigation"
|
||||
|
||||
import { PaymentCallbackStatusEnum } from "@scandic-hotels/common/constants/paymentCallbackStatusEnum"
|
||||
import { PaymentMethodEnum } from "@scandic-hotels/common/constants/paymentMethod"
|
||||
import {
|
||||
bookingConfirmation,
|
||||
details,
|
||||
@@ -17,10 +18,9 @@ import { HandleSuccessCallback } from "../components/EnterDetails/Payment/Paymen
|
||||
import { serverClient } from "../trpc"
|
||||
|
||||
import type { Lang } from "@scandic-hotels/common/constants/language"
|
||||
import type { CreateBookingSchema } from "@scandic-hotels/trpc/routers/booking/mutation/create/schema"
|
||||
|
||||
import type { NextSearchParams } from "../types"
|
||||
import { CreateBookingSchema } from "@scandic-hotels/trpc/routers/booking/mutation/create/schema"
|
||||
import { PaymentMethodEnum } from "@scandic-hotels/common/constants/paymentMethod"
|
||||
|
||||
type PaymentCallbackPageProps = {
|
||||
lang: Lang
|
||||
@@ -118,6 +118,7 @@ export async function PaymentCallbackPage({
|
||||
await caller.booking.validatePartnerPayment({ confirmationNumber })
|
||||
}
|
||||
|
||||
// eslint-disable-next-line react-hooks/purity
|
||||
const expire = Math.floor(Date.now() / 1000) + 60
|
||||
const sig = encrypt(expire.toString())
|
||||
const confirmationUrl = `${bookingConfirmation(lang)}?RefId=${encodeURIComponent(refId)}`
|
||||
|
||||
@@ -49,6 +49,7 @@ export async function SelectRatePage({
|
||||
// If someone tries to update the url with
|
||||
// a bookingCode also, then we need to remove it
|
||||
if (isRedemption && searchParams.bookingCode) {
|
||||
// eslint-disable-next-line react-hooks/immutability
|
||||
delete searchParams.bookingCode
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user