Merged in feat/basic-user (pull request #3135)

feat(SW-3610): Get basic user from api

* feat(SW-3610): Get basic user from api

* .

* Optional profileid


Approved-by: Anton Gunnarsson
This commit is contained in:
Linus Flood
2025-11-12 14:00:56 +00:00
parent 88644597df
commit 19495eed28
11 changed files with 123 additions and 23 deletions

View File

@@ -2,6 +2,7 @@ import type { Lang } from "@scandic-hotels/common/constants/language"
import type { User } from "next-auth"
import type { JWT } from "next-auth/jwt"
import type { getBasicUser } from "./routers/user/utils/getBasicUser"
import type { getVerifiedUser } from "./routers/user/utils/getVerifiedUser"
type Session = {
@@ -12,6 +13,7 @@ type Session = {
}
type ScandicUser = Awaited<ReturnType<typeof getVerifiedUser>>
type ScandicBasicUser = Awaited<ReturnType<typeof getBasicUser>>
type CreateContextOptions = {
auth: () => Promise<Session | null>
lang: Lang
@@ -26,6 +28,7 @@ type CreateContextOptions = {
getScandicUser: (input?: {
withExtendedPartnerData: boolean
}) => Promise<ScandicUser | null>
getScandicBasicUser: () => Promise<ScandicBasicUser | null>
}
export function createContext(opts: CreateContextOptions) {
@@ -41,6 +44,7 @@ export function createContext(opts: CreateContextOptions) {
getScandicUserToken: opts.getScandicUserToken,
getUserPointsBalance: opts.getUserPointsBalance,
getScandicUser: opts.getScandicUser,
getScandicBasicUser: opts.getScandicBasicUser,
}
}