From 2839e49ccb6267310586bca89a280849ae65234a Mon Sep 17 00:00:00 2001 From: pandeymangg Date: Mon, 6 May 2024 16:52:57 +0530 Subject: [PATCH] testing --- .../[environmentId]/settings/billing/page.tsx | 4 ++++ packages/ee/lib/service.ts | 4 ++++ packages/lib/utils/multiLanguage.ts | 17 ----------------- 3 files changed, 8 insertions(+), 17 deletions(-) delete mode 100644 packages/lib/utils/multiLanguage.ts diff --git a/apps/web/app/(app)/environments/[environmentId]/settings/billing/page.tsx b/apps/web/app/(app)/environments/[environmentId]/settings/billing/page.tsx index da026b34ca..09df9a47eb 100644 --- a/apps/web/app/(app)/environments/[environmentId]/settings/billing/page.tsx +++ b/apps/web/app/(app)/environments/[environmentId]/settings/billing/page.tsx @@ -1,3 +1,4 @@ +import { getIsEnterpriseEdition } from "@formbricks/ee/lib/service"; import { PRICING_APPSURVEYS_FREE_RESPONSES, PRICING_USERTARGETING_FREE_MTU } from "@formbricks/lib/constants"; import { getMonthlyActiveTeamPeopleCount, @@ -19,6 +20,9 @@ export default async function BillingPage({ params }) { getMonthlyTeamResponseCount(team.id), ]); + const isEnterpriseEdition = await getIsEnterpriseEdition(); + console.log("GETTING IS ENTERPRISE EDITION: ", isEnterpriseEdition); + return ( <>
diff --git a/packages/ee/lib/service.ts b/packages/ee/lib/service.ts index 03529ec3ef..6d9000fde8 100644 --- a/packages/ee/lib/service.ts +++ b/packages/ee/lib/service.ts @@ -63,6 +63,7 @@ export const getIsEnterpriseEdition = async (): Promise => { }, }); + console.log("CALLING LICENSE CHECK \n\n"); const res = await fetch("https://ee.formbricks.com/api/licenses/check", { body: JSON.stringify({ licenseKey: ENTERPRISE_LICENSE_KEY, @@ -72,6 +73,9 @@ export const getIsEnterpriseEdition = async (): Promise => { method: "POST", }); + console.log("RESPONSE: ", res); + console.log("\n\n\n"); + if (res.ok) { const responseJson = await res.json(); return responseJson.data.status === "active"; diff --git a/packages/lib/utils/multiLanguage.ts b/packages/lib/utils/multiLanguage.ts deleted file mode 100644 index 0ea898c25c..0000000000 --- a/packages/lib/utils/multiLanguage.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { ENTERPRISE_LICENSE_KEY, IS_FORMBRICKS_CLOUD } from "../constants"; -import { getTeam } from "../team/service"; - -export const getIsEnterpriseEdition = (): boolean => { - if (ENTERPRISE_LICENSE_KEY) { - return ENTERPRISE_LICENSE_KEY.length > 0; - } - return false; -}; - -export const getMultiLanguagePermission = async (teamId: string): Promise => { - const team = await getTeam(teamId); - if (!team) return false; - if (IS_FORMBRICKS_CLOUD) return team.billing.features.inAppSurvey.status !== "inactive"; - else if (!IS_FORMBRICKS_CLOUD) return getIsEnterpriseEdition(); - else return false; -};