Files
web/packages/tracking/lib/useTrackingUserData.ts
Linus Flood db546d7167 Merged in feat/SW-3494-noOfNightsStayed (pull request #2832)
feat(SW-3494): removed properties that we dont need in the tracking

* feat(SW-3494): removed properties that we dont need in the tracking

* Fixed waiting on user response before tracking

* Refactor and cleanup

* Cleanup


Approved-by: Joakim Jäderberg
2025-09-22 07:38:05 +00:00

18 lines
481 B
TypeScript

"use client"
import { trpc } from "@scandic-hotels/trpc/client"
import type { TrackingSDKUserData } from "./types"
export const useTrackingUserData = () => {
const { data, isError, isPending } = trpc.user.userTrackingInfo.useQuery()
const userData: TrackingSDKUserData | undefined = !isPending
? isError || !data
? ({ loginStatus: "Error" } as const)
: { ...data, memberType: "scandic-friends" }
: undefined
return { userData, isPending, isError }
}