Papermark is the open-source DocSend alternative and secure data rooms with built-in analytics and custom domains.
Feat: Add team brand fallback for dataroom links
Cursor Agente48674bb7d2b
diff --git a/lib/api/links/link-data.ts b/lib/api/links/link-data.tsindex a6407de7..639216d1 100644--- a/lib/api/links/link-data.ts+++ b/lib/api/links/link-data.ts@@ -299,6 +299,7 @@ export async function fetchDataroomDocumentLinkData({id: true,name: true,description: true,+ teamId: true,allowBulkDownload: true,showLastUpdated: true,documents: {@@ -339,7 +340,7 @@ export async function fetchDataroomDocumentLinkData({throw new Error("Dataroom not found");}- const brand = await prisma.dataroomBrand.findFirst({+ const dataroomBrand = await prisma.dataroomBrand.findFirst({where: {dataroomId: linkData.dataroom.id,},@@ -352,6 +353,27 @@ export async function fetchDataroomDocumentLinkData({},});+ const teamBrand = await prisma.brand.findFirst({+ where: {+ teamId: linkData.dataroom.teamId,+ },+ select: {+ logo: true,+ banner: true,+ brandColor: true,+ accentColor: true,+ welcomeMessage: true,+ },+ });++ const brand = {+ logo: dataroomBrand?.logo || teamBrand?.logo,+ banner: dataroomBrand?.banner || teamBrand?.banner || null,+ brandColor: dataroomBrand?.brandColor || teamBrand?.brandColor,+ accentColor: dataroomBrand?.accentColor || teamBrand?.accentColor,+ welcomeMessage: dataroomBrand?.welcomeMessage || teamBrand?.welcomeMessage,+ };+return { linkData, brand };}