Skip to content

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

fix: datarooms views on document cards

Marc Seitz87e55c189d03
diff --git a/pages/api/teams/[teamId]/datarooms/[id]/documents/index.ts b/pages/api/teams/[teamId]/datarooms/[id]/documents/index.ts
index c5cf1e73..d7b03f8b 100644
--- a/pages/api/teams/[teamId]/datarooms/[id]/documents/index.ts
+++ b/pages/api/teams/[teamId]/datarooms/[id]/documents/index.ts
@@ -64,7 +64,7 @@ export default async function handle(
type: true,
_count: {
select: {
- views: { where: { viewType: "DATAROOM_VIEW" } },
+ views: { where: { dataroomId } },
versions: true,
},
},
diff --git a/pages/api/teams/[teamId]/datarooms/[id]/folders/documents/[...name].ts b/pages/api/teams/[teamId]/datarooms/[id]/folders/documents/[...name].ts
index a905d943..5831bf5a 100644
--- a/pages/api/teams/[teamId]/datarooms/[id]/folders/documents/[...name].ts
+++ b/pages/api/teams/[teamId]/datarooms/[id]/folders/documents/[...name].ts
@@ -83,7 +83,7 @@ export default async function handle(
type: true,
_count: {
select: {
- views: { where: { viewType: "DATAROOM_VIEW" } },
+ views: { where: { dataroomId } },
versions: true,
},
},