From aa40b916ab4f0e66a8d804c7fab1911a2e5942fd Mon Sep 17 00:00:00 2001 From: Matthias Nannt Date: Mon, 29 Jul 2024 10:19:32 +0200 Subject: [PATCH] chore: remove legacy unlimited prices --- .../billing/unlimited199/page.tsx | 30 ------------------- packages/lib/constants.ts | 2 -- 2 files changed, 32 deletions(-) delete mode 100644 apps/web/app/(app)/environments/[environmentId]/settings/(organization)/billing/unlimited199/page.tsx diff --git a/apps/web/app/(app)/environments/[environmentId]/settings/(organization)/billing/unlimited199/page.tsx b/apps/web/app/(app)/environments/[environmentId]/settings/(organization)/billing/unlimited199/page.tsx deleted file mode 100644 index f98744aef9..0000000000 --- a/apps/web/app/(app)/environments/[environmentId]/settings/(organization)/billing/unlimited199/page.tsx +++ /dev/null @@ -1,30 +0,0 @@ -import { redirect } from "next/navigation"; -import { STRIPE_PRICE_LOOKUP_KEYS } from "@formbricks/lib/constants"; -import { getOrganizationByEnvironmentId } from "@formbricks/lib/organization/service"; -import { upgradePlanAction } from "../actions"; - -const Page = async ({ params }) => { - const organization = await getOrganizationByEnvironmentId(params.environmentId); - if (!organization) { - throw new Error("Organization not found"); - } - - const { status, newPlan, url } = await upgradePlanAction( - organization.id, - params.environmentId, - STRIPE_PRICE_LOOKUP_KEYS.UNLIMITED_199 - ); - - if (status != 200) { - throw new Error("Something went wrong"); - } - if (newPlan && url) { - redirect(url); - } else if (!newPlan) { - redirect(`/billing-confirmation?environmentId=${params.environmentId}`); - } else { - throw new Error("Something went wrong"); - } -}; - -export default Page; diff --git a/packages/lib/constants.ts b/packages/lib/constants.ts index 82bed0ea4f..c00c1afb09 100644 --- a/packages/lib/constants.ts +++ b/packages/lib/constants.ts @@ -193,8 +193,6 @@ export enum STRIPE_PRICE_LOOKUP_KEYS { STARTUP_YEARLY = "formbricks_startup_yearly", SCALE_MONTHLY = "formbricks_scale_monthly", SCALE_YEARLY = "formbricks_scale_yearly", - UNLIMITED_99 = "formbricks_unlimited_99", - UNLIMITED_199 = "formbricks_unlimited_199", } export const BILLING_LIMITS = {