fix: allow any membership level

This commit is contained in:
Michael Zetterberg
2024-08-27 07:40:07 +02:00
parent fcf0f58ab8
commit 2ea6a2d242
4 changed files with 9 additions and 5 deletions

View File

@@ -1,7 +1,5 @@
import { z } from "zod"
import { MembershipLevelEnum } from "@/constants/membershipLevels"
import { countriesMap } from "@/components/TempDesignSystem/Form/Country/countries"
export const getUserSchema = z.object({
@@ -22,7 +20,7 @@ export const getUserSchema = z.object({
currentPoints: z.number(),
expirationDate: z.string(),
membershipNumber: z.string(),
membershipLevel: z.nativeEnum(MembershipLevelEnum).optional(),
membershipLevel: z.string().optional(),
memberSince: z.string(),
membershipType: z.string(),
nextLevel: z.string().optional(),

View File

@@ -33,6 +33,7 @@ import type {
LoginType,
TrackingSDKUserData,
} from "@/types/components/tracking"
import type { MembershipLevel } from "@/constants/membershipLevels"
// OpenTelemetry metrics: User
const meter = metrics.getMeter("trpc.user")
@@ -437,7 +438,7 @@ export const userQueryRouter = router({
loginStatus: "logged in",
loginType: ctx.session.token.loginType as LoginType,
memberId: membership?.membershipNumber,
memberLevel: membership?.membershipLevel,
memberLevel: membership?.membershipLevel as MembershipLevel,
noOfNightsStayed: verifiedPreviousStaysData.data.links?.totalCount ?? 0,
totalPointsAvailableToSpend: membership?.currentPoints,
loginAction: "login success",