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
This commit is contained in:
Linus Flood
2025-09-22 07:38:05 +00:00
parent 9770281863
commit db546d7167
7 changed files with 76 additions and 95 deletions

View File

@@ -0,0 +1,17 @@
"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 }
}