fix some errors

This commit is contained in:
miloschwartz
2026-02-09 20:23:55 -08:00
parent ba5ae6ed04
commit ed40eae655
4 changed files with 12 additions and 46 deletions

View File

@@ -45,7 +45,7 @@ export function verifyValidSubscription(tiers: Tier[]) {
}
const { tier, active } = await getOrgTierData(orgId);
const isTier = tiers.includes(tier || "");
const isTier = tiers.includes(tier as Tier);
if (!active) {
return next(
createHttpError(

View File

@@ -90,7 +90,7 @@ export async function handleSubscriptionUpdated(
const itemsToUpsert = fullSubscription.items.data.map((item) => {
// Try to get featureId from price
let featureId: string | null = getFeatureIdByPriceId(item.price.id) || null;
// If no match, try to preserve existing featureId
if (!featureId) {
const existingItem = existingItems.find(

View File

@@ -37,10 +37,6 @@ import { cn } from "@app/lib/cn";
import {
CreditCard,
ExternalLink,
Users,
Globe,
Server,
Layout,
Check
} from "lucide-react";
import {
@@ -50,7 +46,6 @@ import {
import { useTranslations } from "use-intl";
import Link from "next/link";
import { Tier } from "@server/types/Tiers";
import { w } from "@faker-js/faker/dist/airline-DF6RqYmq";
// Plan tier definitions matching the mockup
type PlanId = "free" | "homelab" | "team" | "business" | "enterprise";
@@ -63,35 +58,6 @@ interface PlanOption {
tierType: Tier | null;
}
// Tier limits for display in confirmation dialog
interface TierLimits {
sites: number;
users: number;
domains: number;
remoteNodes: number;
}
const tierLimits: Record<Tier, TierLimits> = {
tier1: {
sites: 3,
users: 3,
domains: 3,
remoteNodes: 1
},
tier2: {
sites: 10,
users: 150,
domains: 250,
remoteNodes: 5
},
tier3: {
sites: 10,
users: 150,
domains: 250,
remoteNodes: 5
}
};
const planOptions: PlanOption[] = [
{
id: "free",

View File

@@ -616,7 +616,7 @@ export default function GeneralPage() {
{t("diskEncrypted")}
</InfoSectionTitle>
<InfoSectionContent>
{isPaidUser
{isPaidUser(tierMatrix.devicePosture)
? formatPostureValue(
client.posture
.diskEncrypted
@@ -634,7 +634,7 @@ export default function GeneralPage() {
{t("firewallEnabled")}
</InfoSectionTitle>
<InfoSectionContent>
{isPaidUser
{isPaidUser(tierMatrix.devicePosture)
? formatPostureValue(
client.posture
.firewallEnabled
@@ -653,7 +653,7 @@ export default function GeneralPage() {
{t("autoUpdatesEnabled")}
</InfoSectionTitle>
<InfoSectionContent>
{isPaidUser
{isPaidUser(tierMatrix.devicePosture)
? formatPostureValue(
client.posture
.autoUpdatesEnabled
@@ -671,7 +671,7 @@ export default function GeneralPage() {
{t("tpmAvailable")}
</InfoSectionTitle>
<InfoSectionContent>
{isPaidUser
{isPaidUser(tierMatrix.devicePosture)
? formatPostureValue(
client.posture
.tpmAvailable
@@ -693,7 +693,7 @@ export default function GeneralPage() {
)}
</InfoSectionTitle>
<InfoSectionContent>
{isPaidUser
{isPaidUser(tierMatrix.devicePosture)
? formatPostureValue(
client.posture
.windowsAntivirusEnabled
@@ -711,7 +711,7 @@ export default function GeneralPage() {
{t("macosSipEnabled")}
</InfoSectionTitle>
<InfoSectionContent>
{isPaidUser
{isPaidUser(tierMatrix.devicePosture)
? formatPostureValue(
client.posture
.macosSipEnabled
@@ -733,7 +733,7 @@ export default function GeneralPage() {
)}
</InfoSectionTitle>
<InfoSectionContent>
{isPaidUser
{isPaidUser(tierMatrix.devicePosture)
? formatPostureValue(
client.posture
.macosGatekeeperEnabled
@@ -755,7 +755,7 @@ export default function GeneralPage() {
)}
</InfoSectionTitle>
<InfoSectionContent>
{isPaidUser
{isPaidUser(tierMatrix.devicePosture)
? formatPostureValue(
client.posture
.macosFirewallStealthMode
@@ -774,7 +774,7 @@ export default function GeneralPage() {
{t("linuxAppArmorEnabled")}
</InfoSectionTitle>
<InfoSectionContent>
{isPaidUser
{isPaidUser(tierMatrix.devicePosture)
? formatPostureValue(
client.posture
.linuxAppArmorEnabled
@@ -793,7 +793,7 @@ export default function GeneralPage() {
{t("linuxSELinuxEnabled")}
</InfoSectionTitle>
<InfoSectionContent>
{isPaidUser
{isPaidUser(tierMatrix.devicePosture)
? formatPostureValue(
client.posture
.linuxSELinuxEnabled