mirror of
https://github.com/formbricks/formbricks.git
synced 2025-12-30 10:19:51 -06:00
improve posthog events in hq
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user