Skip to content

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

chore: reduce fetching data from prisma

Marc Seitzc463eb70f901
diff --git a/pages/api/teams/[teamId]/datarooms/[id]/groups/[groupId]/links.ts b/pages/api/teams/[teamId]/datarooms/[id]/groups/[groupId]/links.ts
index 76bed8e2..4878dcd4 100644
--- a/pages/api/teams/[teamId]/datarooms/[id]/groups/[groupId]/links.ts
+++ b/pages/api/teams/[teamId]/datarooms/[id]/groups/[groupId]/links.ts
@@ -67,6 +67,7 @@ export default async function handle(
orderBy: {
viewedAt: "desc",
},
+ take: 1,
},
customFields: true,
_count: {
@@ -74,7 +75,6 @@ export default async function handle(
},
},
});
- console.log("links", links);
// Decrypt the password for each link
links.forEach((link) => {