fix(SW-1710): use access object references instead
correct incorrect test that granted access incorrectly
This commit is contained in:
@@ -47,12 +47,11 @@ export async function MyStay({ refId }: { refId: string }) {
|
||||
|
||||
const { booking, hotel, room } = bookingConfirmation
|
||||
const user = await getProfileSafely()
|
||||
const cookie = cookies()
|
||||
const bv = cookie.get("bv")?.value
|
||||
const bv = cookies().get("bv")?.value
|
||||
const intl = await getIntl()
|
||||
|
||||
const access = accessBooking(booking.guest, lastName, user, bv)
|
||||
if (access.status === ACCESS_GRANTED.status) {
|
||||
if (access === ACCESS_GRANTED) {
|
||||
const linkedBookingPromises = booking.linkedReservations
|
||||
? booking.linkedReservations.map((linkedBooking) => {
|
||||
return getBookingConfirmation(linkedBooking.confirmationNumber)
|
||||
@@ -122,7 +121,7 @@ export async function MyStay({ refId }: { refId: string }) {
|
||||
)
|
||||
}
|
||||
|
||||
if (access.status === ERROR_BAD_REQUEST.status) {
|
||||
if (access === ERROR_BAD_REQUEST) {
|
||||
return (
|
||||
<main className={styles.main}>
|
||||
<div className={styles.form}>
|
||||
@@ -135,7 +134,7 @@ export async function MyStay({ refId }: { refId: string }) {
|
||||
)
|
||||
}
|
||||
|
||||
if (access.status === ERROR_UNAUTHORIZED.status) {
|
||||
if (access === ERROR_UNAUTHORIZED) {
|
||||
return (
|
||||
<main className={styles.main}>
|
||||
<div className={styles.logIn}>
|
||||
|
||||
Reference in New Issue
Block a user