improve posthog events in hq

This commit is contained in:
Matthias Nannt
2022-12-07 16:47:57 +01:00
parent b0554757df
commit 273aad391e
2 changed files with 4 additions and 3 deletions

View File

@@ -1,4 +1,5 @@
import { getSessionOrUser } from "@/lib/apiHelper";
import { capturePosthogEvent } from "@/lib/posthog";
import { prisma } from "@formbricks/database";
import type { NextApiRequest, NextApiResponse } from "next";
@@ -56,6 +57,9 @@ export default async function handle(req: NextApiRequest, res: NextApiResponse)
const prismaRes = await prisma.form.delete({
where: { id: formId },
});
capturePosthogEvent(teamId, "form created", {
formId,
});
return res.json(prismaRes);
}

View File

@@ -57,9 +57,6 @@ export default async function handle(req: NextApiRequest, res: NextApiResponse)
const prismaRes = await prisma.submission.delete({
where: { id: submissionId },
});
capturePosthogEvent(teamId, "form deleted", {
formId,
});
return res.json(prismaRes);
}