Skip to content

The Open Source DocuSign Alternative.

fix: add team context to more vanilla client usages

Mythie7e31323faa52
diff --git a/apps/web/src/app/(dashboard)/documents/[id]/document-page-view-button.tsx b/apps/web/src/app/(dashboard)/documents/[id]/document-page-view-button.tsx
index 2bc5e83b1..a477d75c6 100644
--- a/apps/web/src/app/(dashboard)/documents/[id]/document-page-view-button.tsx
+++ b/apps/web/src/app/(dashboard)/documents/[id]/document-page-view-button.tsx
@@ -46,9 +46,16 @@ export const DocumentPageViewButton = ({ document }: DocumentPageViewButtonProps
const onDownloadClick = async () => {
try {
- const documentWithData = await trpcClient.document.getDocumentById.query({
- documentId: document.id,
- });
+ const documentWithData = await trpcClient.document.getDocumentById.query(
+ {
+ documentId: document.id,
+ },
+ {
+ context: {
+ teamId: document.team?.id?.toString(),
+ },
+ },
+ );
const documentData = documentWithData?.documentData;
diff --git a/apps/web/src/app/(dashboard)/documents/[id]/document-page-view-dropdown.tsx b/apps/web/src/app/(dashboard)/documents/[id]/document-page-view-dropdown.tsx
index a4c79ec33..5075f342c 100644
--- a/apps/web/src/app/(dashboard)/documents/[id]/document-page-view-dropdown.tsx
+++ b/apps/web/src/app/(dashboard)/documents/[id]/document-page-view-dropdown.tsx
@@ -74,9 +74,16 @@ export const DocumentPageViewDropdown = ({ document, team }: DocumentPageViewDro
const onDownloadClick = async () => {
try {
- const documentWithData = await trpcClient.document.getDocumentById.query({
- documentId: document.id,
- });
+ const documentWithData = await trpcClient.document.getDocumentById.query(
+ {
+ documentId: document.id,
+ },
+ {
+ context: {
+ teamId: team?.id?.toString(),
+ },
+ },
+ );
const documentData = documentWithData?.documentData;