Skip to content

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

feat: disable page links on free

Marc Seitz9a67cb4b1c27
diff --git a/pages/api/views-dataroom.ts b/pages/api/views-dataroom.ts
index 927394e4..372f5abf 100644
--- a/pages/api/views-dataroom.ts
+++ b/pages/api/views-dataroom.ts
@@ -117,6 +117,11 @@ export default async function handle(
dataroom: {
select: {
teamId: true,
+ team: {
+ select: {
+ plan: true,
+ },
+ },
},
},
},
@@ -572,8 +577,8 @@ export default async function handle(
file: true,
storageType: true,
pageNumber: true,
- embeddedLinks: true,
- pageLinks: true,
+ embeddedLinks: !link.dataroom?.team.plan.includes("free"),
+ pageLinks: !link.dataroom?.team.plan.includes("free"),
metadata: true,
},
});
diff --git a/pages/api/views.ts b/pages/api/views.ts
index 645f8eca..639222f8 100644
--- a/pages/api/views.ts
+++ b/pages/api/views.ts
@@ -95,6 +95,15 @@ export default async function handle(
agreementId: true,
enableWatermark: true,
watermarkConfig: true,
+ document: {
+ select: {
+ team: {
+ select: {
+ plan: true,
+ },
+ },
+ },
+ },
},
});
@@ -419,8 +428,8 @@ export default async function handle(
file: true,
storageType: true,
pageNumber: true,
- embeddedLinks: true,
- pageLinks: true,
+ embeddedLinks: !link.document?.team.plan.includes("free"),
+ pageLinks: !link.document?.team.plan.includes("free"),
metadata: true,
},
});