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

@@ -9,7 +9,7 @@ import { safeTry } from "@scandic-hotels/common/utils/safeTry"
import * as api from "../../../api"
import { protectedProcedure } from "../../../procedures"
import { getUserSchema } from "../../user/output"
import { getVerifiedUser } from "../../user/utils/getVerifiedUser"
import { getBasicUser } from "../../user/utils/getBasicUser"
import type { FriendsTier } from "../../../types/user"
@@ -33,12 +33,12 @@ export const performLevelUpgrade = protectedProcedure
}
const [profile, error] = await safeTry(
getVerifiedUser({ token: ctx.session.token })
getBasicUser({ token: ctx.session.token })
)
if (!profile?.membership || error) {
if (!profile || error) {
return { tierMatchState: "error" }
}
const currentLevel = profile.membership.membershipLevel
const currentLevel = profile.tier
sasLogger.debug("tier match started")