Skip to content

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

feat: show dataroom internal name in sidebar when present

Cursor Agentfe3604ee8aa3
diff --git a/components/sidebar/app-sidebar.tsx b/components/sidebar/app-sidebar.tsx
index 792b7417..4bab333c 100644
--- a/components/sidebar/app-sidebar.tsx
+++ b/components/sidebar/app-sidebar.tsx
@@ -97,7 +97,7 @@ export function AppSidebar({ ...props }: React.ComponentProps<typeof Sidebar>) {
const dataroomItems =
datarooms && datarooms.length > 0
? datarooms.slice(0, 5).map((dataroom) => ({
- title: dataroom.name,
+ title: dataroom.internalName || dataroom.name,
url: `/datarooms/${dataroom.id}/documents`,
current:
router.pathname.includes("/datarooms/[id]") &&
diff --git a/lib/swr/use-datarooms-simple.ts b/lib/swr/use-datarooms-simple.ts
index 0da824d1..127592b6 100644
--- a/lib/swr/use-datarooms-simple.ts
+++ b/lib/swr/use-datarooms-simple.ts
@@ -4,7 +4,7 @@ import useSWR from "swr";
import { fetcher } from "@/lib/utils";
-export type DataroomSimple = Pick<Dataroom, "id" | "name" | "createdAt">;
+export type DataroomSimple = Pick<Dataroom, "id" | "name" | "internalName" | "createdAt">;
type DataroomsSimpleResponse = {
datarooms: DataroomSimple[];
diff --git a/pages/api/teams/[teamId]/datarooms/index.ts b/pages/api/teams/[teamId]/datarooms/index.ts
index e5d1dbdf..3b140f3e 100644
--- a/pages/api/teams/[teamId]/datarooms/index.ts
+++ b/pages/api/teams/[teamId]/datarooms/index.ts
@@ -63,6 +63,7 @@ export default async function handle(
select: {
id: true,
name: true,
+ internalName: true,
createdAt: true,
},
orderBy: {