mirror of
https://github.com/documenso/documenso.git
synced 2025-11-21 20:21:38 +10:00
feat: return the necessary information for document preview and download
This commit is contained in:
@ -10,7 +10,7 @@ import { Button } from '@documenso/ui/primitives/button';
|
||||
import { useToast } from '@documenso/ui/primitives/use-toast';
|
||||
|
||||
export type DocumentDownloadButtonProps = {
|
||||
document: Document & {
|
||||
document: Pick<Document, 'title'> & {
|
||||
documentData: DocumentData;
|
||||
};
|
||||
};
|
||||
|
||||
@ -13,11 +13,23 @@ export const getDocumentByAccessToken = async ({ token }: GetDocumentByAccessTok
|
||||
where: {
|
||||
token,
|
||||
},
|
||||
include: {
|
||||
select: {
|
||||
document: {
|
||||
include: {
|
||||
documentData: true,
|
||||
documentMeta: true,
|
||||
select: {
|
||||
title: true,
|
||||
documentData: {
|
||||
select: {
|
||||
id: true,
|
||||
type: true,
|
||||
data: true,
|
||||
initialData: true,
|
||||
},
|
||||
},
|
||||
documentMeta: {
|
||||
select: {
|
||||
password: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user