chore: remove unused method and restructure env var fetching for team roles (#1595)

Co-authored-by: Matti Nannt <mail@matthiasnannt.com>
This commit is contained in:
Shubham Palriwala
2023-11-09 15:36:57 +05:30
committed by GitHub
parent dd0f0ead39
commit a34606ab03
2 changed files with 2 additions and 19 deletions
+1 -4
View File
@@ -1,10 +1,7 @@
import "server-only";
import { env } from "../../../apps/web/env.mjs";
import { unstable_cache } from "next/cache";
// Enterprise License constant
export const ENTERPRISE_LICENSE_KEY = env.ENTERPRISE_LICENSE_KEY;
import { ENTERPRISE_LICENSE_KEY } from "@formbricks/lib/constants";
export const getIsEnterpriseEdition = () =>
unstable_cache(
+1 -15
View File
@@ -1,7 +1,5 @@
import "server-only";
import path from "path";
import { env } from "@/env.mjs";
import { unstable_cache } from "next/cache";
export const IS_FORMBRICKS_CLOUD = process.env.IS_FORMBRICKS_CLOUD === "1";
export const REVALIDATION_INTERVAL = 0; //TODO: find a good way to cache and revalidate data when it changes
@@ -85,16 +83,4 @@ export const LOCAL_UPLOAD_URL = {
export const PRICING_USERTARGETING_FREE_MTU = 2500;
export const PRICING_APPSURVEYS_FREE_RESPONSES = 250;
// Enterprise License constant
export const ENTERPRISE_LICENSE_KEY = env.ENTERPRISE_LICENSE_KEY;
export const getIsEnterpriseEdition = () =>
unstable_cache(
async () => {
if (ENTERPRISE_LICENSE_KEY) {
return ENTERPRISE_LICENSE_KEY?.length > 0;
}
return false;
},
["isEE"],
{ revalidate: 60 * 60 * 24 }
)();
export const ENTERPRISE_LICENSE_KEY = process.env.ENTERPRISE_LICENSE_KEY;