Papermark is the open-source DocSend alternative and secure data rooms with built-in analytics and custom domains.
fix: add trigger event
Marc Seitz567bf655333d
diff --git a/pages/api/teams/[teamId]/documents/index.ts b/pages/api/teams/[teamId]/documents/index.tsindex 42e37d4e..613d974e 100644--- a/pages/api/teams/[teamId]/documents/index.ts+++ b/pages/api/teams/[teamId]/documents/index.ts@@ -7,6 +7,7 @@ import { getExtension, log } from "@/lib/utils";import { identifyUser, trackAnalytics } from "@/lib/analytics";import { getTeamWithUsersAndDocument } from "@/lib/team/helper";import { errorhandler } from "@/lib/errorHandler";+import { client } from "@/trigger";export default async function handle(req: NextApiRequest,@@ -126,6 +127,12 @@ export default async function handle(customDomain: null,});+ // trigger document uploaded event to trigger convert-pdf-to-image job+ await client.sendEvent({+ name: "document.uploaded",+ payload: { documentVersionId: document.versions[0].id },+ });+return res.status(201).json(document);} catch (error) {log(`Failed to create document. Error: \n\n ${error}`);