Skip to content

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

feat: scope webhook

Marc Seitzcb56b4742b9d
diff --git a/pages/api/webhooks/services/[...path]/index.ts b/pages/api/webhooks/services/[...path]/index.ts
index e0467900..0f4d4049 100644
--- a/pages/api/webhooks/services/[...path]/index.ts
+++ b/pages/api/webhooks/services/[...path]/index.ts
@@ -850,6 +850,15 @@ async function handleDataroomCreate(
) {
const { name, description, createLink, link, folders } = data;
+ // Check if team is paused
+ const teamIsPaused = await isTeamPausedById(teamId);
+ if (teamIsPaused) {
+ return res.status(403).json({
+ error:
+ "Team is currently paused. New dataroom creation is not available.",
+ });
+ }
+
// If custom domain and slug are provided for link, validate them
let domainId = null;
if (createLink && link?.domain && link?.slug) {