Skip to content

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

feat: add teamId when creating link on document

Marc Seitze89efe8e16b4
diff --git a/components/documents/document-card.tsx b/components/documents/document-card.tsx
index ab3ed85d..c5c42568 100644
--- a/components/documents/document-card.tsx
+++ b/components/documents/document-card.tsx
@@ -286,13 +286,14 @@ export default function DocumentsCard({
<FolderInputIcon className="mr-2 h-4 w-4" />
Move to folder
</DropdownMenuItem>
- <DropdownMenuItem
+ {/* INFO: Duplicate document is disabled for now */}
+ {/* <DropdownMenuItem
onClick={(e) => handleDuplicateDocument(e)}
disabled={!canAddDocuments}
>
<Layers2Icon className="mr-2 h-4 w-4" />
Duplicate document
- </DropdownMenuItem>
+ </DropdownMenuItem> */}
{datarooms && datarooms.length !== 0 && (
<DropdownMenuItem onClick={() => setAddDataroomOpen(true)}>
<BetweenHorizontalStartIcon className="mr-2 h-4 w-4" />
diff --git a/pages/api/teams/[teamId]/documents/[id]/duplicate.ts b/pages/api/teams/[teamId]/documents/[id]/duplicate.ts
index 0a6f4eee..7e43db41 100644
--- a/pages/api/teams/[teamId]/documents/[id]/duplicate.ts
+++ b/pages/api/teams/[teamId]/documents/[id]/duplicate.ts
@@ -121,9 +121,6 @@ export default async function handle(
},
},
},
- links: {
- create: {},
- },
},
});
diff --git a/pages/api/teams/[teamId]/documents/agreement.ts b/pages/api/teams/[teamId]/documents/agreement.ts
index e4ebe136..82cc6084 100644
--- a/pages/api/teams/[teamId]/documents/agreement.ts
+++ b/pages/api/teams/[teamId]/documents/agreement.ts
@@ -85,6 +85,7 @@ export default async function handle(
emailProtected: false,
enableFeedback: false,
enableNotification: false,
+ teamId,
},
},
versions: {
diff --git a/pages/api/teams/[teamId]/documents/index.ts b/pages/api/teams/[teamId]/documents/index.ts
index 1502c23a..ec0969c1 100644
--- a/pages/api/teams/[teamId]/documents/index.ts
+++ b/pages/api/teams/[teamId]/documents/index.ts
@@ -188,7 +188,9 @@ export default async function handle(
teamId: teamId,
...(createLink && {
links: {
- create: {},
+ create: {
+ teamId,
+ },
},
}),
versions: {