Merged in fix/SW-3536-wl-cannot-initialize-payment- (pull request #2953)

fix SW-3536 Fixed create booking call for sas logged in users in the partner site
Approved-by: Anton Gunnarsson
This commit is contained in:
Hrishikesh Vaipurkar
2025-10-14 09:35:53 +00:00
parent 01e9542ded
commit 73af1eed9b
4 changed files with 43 additions and 26 deletions

View File

@@ -1,3 +1,4 @@
import { LoginTypeEnum } from "@scandic-hotels/common/constants/loginType"
import { createCounter } from "@scandic-hotels/common/telemetry"
import * as api from "../../api"
@@ -7,6 +8,7 @@ import { createBookingSchema } from "./mutation/create/schema"
import { bookingConfirmationSchema } from "./output"
import type { Lang } from "@scandic-hotels/common/constants/language"
import type { Session } from "next-auth"
export async function getBooking(
confirmationNumber: string,
@@ -157,3 +159,9 @@ export async function cancelBooking(
return verifiedData.data
}
// ToDo - Update the function to return true for Scandic site and
// in case of Partner sites fetch the Scandic Curity token for linked user and service token for unlinked user
export function isPartnerLoggedInUser(session: Session) {
return session.token.loginType === LoginTypeEnum.sas
}