Skip to content

Papermark is the open-source DocSend alternative and secure data rooms with built-in analytics and custom domains.

fix: dataroom.create endpoint

Marc Seitz13f933778e7a
diff --git a/pages/api/webhooks/services/[...path]/index.ts b/pages/api/webhooks/services/[...path]/index.ts
index 519cfee5..5dad52fa 100644
--- a/pages/api/webhooks/services/[...path]/index.ts
+++ b/pages/api/webhooks/services/[...path]/index.ts
@@ -8,6 +8,7 @@ import { z } from "zod";
import { hashToken } from "@/lib/api/auth/token";
import { createDocument } from "@/lib/documents/create-document";
import { putFileServer } from "@/lib/files/put-file-server";
+import { newId } from "@/lib/id-helper";
import { extractTeamId, isValidWebhookId } from "@/lib/incoming-webhooks";
import prisma from "@/lib/prisma";
import { ratelimit } from "@/lib/redis";
@@ -839,11 +840,15 @@ async function handleDataroomCreate(
// Create the dataroom
try {
+ // Generate unique public ID for the dataroom
+ const pId = newId("dataroom");
+
// Create dataroom with link if requested
let createData: any = {
name,
description,
teamId,
+ pId,
};
if (createLink && link) {