mirror of
https://github.com/formbricks/formbricks.git
synced 2026-01-06 05:40:02 -06:00
testing
This commit is contained in:
@@ -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 (
|
||||
<>
|
||||
<div>
|
||||
|
||||
@@ -63,6 +63,7 @@ export const getIsEnterpriseEdition = async (): Promise<boolean> => {
|
||||
},
|
||||
});
|
||||
|
||||
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<boolean> => {
|
||||
method: "POST",
|
||||
});
|
||||
|
||||
console.log("RESPONSE: ", res);
|
||||
console.log("\n\n\n");
|
||||
|
||||
if (res.ok) {
|
||||
const responseJson = await res.json();
|
||||
return responseJson.data.status === "active";
|
||||
|
||||
@@ -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<boolean> => {
|
||||
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;
|
||||
};
|
||||
Reference in New Issue
Block a user