From a3cb37b1280756f019df72b28ce9e5fc0bb0309d Mon Sep 17 00:00:00 2001 From: pandeymangg Date: Thu, 2 May 2024 15:06:07 +0530 Subject: [PATCH] refactor --- packages/ee/lib/service.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/packages/ee/lib/service.ts b/packages/ee/lib/service.ts index 9f03301f6c..36f2715bf9 100644 --- a/packages/ee/lib/service.ts +++ b/packages/ee/lib/service.ts @@ -49,7 +49,7 @@ export const getIsEnterpriseEdition = async (): Promise => { const startOfYear = new Date(now.getFullYear(), 0, 1); // January 1st of the current year const endOfYear = new Date(now.getFullYear() + 1, 0, 0); // December 31st of the current year - const responseCountForTeam = await prisma.response.count({ + const responseCount = await prisma.response.count({ where: { createdAt: { gte: startOfYear, @@ -58,11 +58,10 @@ export const getIsEnterpriseEdition = async (): Promise => { }, }); - // const res = await fetch("https://ee.formbricks.com/api/licenses/check", { - const res = await fetch("http://localhost:8080/api/licenses/check", { + const res = await fetch("https://ee.formbricks.com/api/licenses/check", { body: JSON.stringify({ licenseKey: ENTERPRISE_LICENSE_KEY, - usage: { responseCount: responseCountForTeam }, + usage: { responseCount: responseCount }, }), headers: { "Content-Type": "application/json" }, method: "POST",