From 9a67cb4b1c2737ecffd5aebdb689a3810a1a4a29 Mon Sep 17 00:00:00 2001 From: Marc Seitz Date: Tue, 8 Oct 2024 17:14:28 +0900 Subject: [PATCH] feat: disable page links on free --- pages/api/views-dataroom.ts | 9 +++++++-- pages/api/views.ts | 13 +++++++++++-- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/pages/api/views-dataroom.ts b/pages/api/views-dataroom.ts index 927394e4d..372f5abf9 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 645f8ecaf..639222f8a 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, }, });