Skip to content

Commit

Permalink
add 'event trigger' event
Browse files Browse the repository at this point in the history
  • Loading branch information
MarconLP committed May 13, 2023
1 parent c5840ce commit 7a85478
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions apps/nextjs/src/pages/api/v1/log.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import type { NextApiRequest, NextApiResponse } from "next";
import { z } from "zod";

import { posthog } from "@acme/api/posthog";
import { prisma } from "@acme/db";

import admin from "~/utils/firebaseAdmin";
Expand Down Expand Up @@ -139,5 +140,19 @@ export default async function handler(
}
}

posthog?.capture({
distinctId: userId,
event: "trigger event",
properties: {
notify,
event,
description,
icon,
projectId: projectDoc[0].id,
channelId: channelDoc[0].id,
},
});
void posthog?.shutdownAsync();

res.send(notification);
}

0 comments on commit 7a85478

Please sign in to comment.