mirror of
https://github.com/formbricks/formbricks.git
synced 2026-02-05 06:10:34 -06:00
fix: posthog ping to send overview (#1804)
Co-authored-by: Matthias Nannt <mail@matthiasnannt.com>
This commit is contained in:
committed by
GitHub
parent
4c85fcb3cd
commit
51cec0184f
@@ -1,6 +1,8 @@
|
||||
import { responses } from "@/app/lib/api/response";
|
||||
import packageJson from "@/package.json";
|
||||
import { headers } from "next/headers";
|
||||
|
||||
import { prisma } from "@formbricks/database";
|
||||
import { CRON_SECRET } from "@formbricks/lib/constants";
|
||||
import { captureTelemetry } from "@formbricks/lib/telemetry";
|
||||
|
||||
@@ -12,7 +14,18 @@ export async function POST() {
|
||||
return responses.notAuthenticatedResponse();
|
||||
}
|
||||
|
||||
captureTelemetry("ping");
|
||||
const [surveyCount, responseCount, userCount] = await Promise.all([
|
||||
prisma.survey.count(),
|
||||
prisma.response.count(),
|
||||
prisma.user.count(),
|
||||
]);
|
||||
|
||||
captureTelemetry("ping", {
|
||||
version: packageJson.version,
|
||||
surveyCount,
|
||||
responseCount,
|
||||
userCount,
|
||||
});
|
||||
|
||||
return responses.successResponse({}, true);
|
||||
}
|
||||
|
||||
@@ -20,7 +20,6 @@ import { personCache } from "../person/cache";
|
||||
import { productCache } from "../product/cache";
|
||||
import { getProductByEnvironmentId } from "../product/service";
|
||||
import { responseCache } from "../response/cache";
|
||||
import { captureTelemetry } from "../telemetry";
|
||||
import { diffInDays, formatDateFields } from "../utils/datetime";
|
||||
import { validateInputs } from "../utils/validate";
|
||||
import { surveyCache } from "./cache";
|
||||
@@ -513,8 +512,6 @@ export const createSurvey = async (environmentId: string, surveyBody: TSurveyInp
|
||||
triggers: survey.triggers.map((trigger) => trigger.actionClass.name),
|
||||
};
|
||||
|
||||
captureTelemetry("survey created");
|
||||
|
||||
surveyCache.revalidate({
|
||||
id: survey.id,
|
||||
environmentId: survey.environmentId,
|
||||
|
||||
Reference in New Issue
Block a user