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';
|
import { useToast } from '@documenso/ui/primitives/use-toast';
|
||||||
|
|
||||||
export type DocumentDownloadButtonProps = {
|
export type DocumentDownloadButtonProps = {
|
||||||
document: Document & {
|
document: Pick<Document, 'title'> & {
|
||||||
documentData: DocumentData;
|
documentData: DocumentData;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@ -13,11 +13,23 @@ export const getDocumentByAccessToken = async ({ token }: GetDocumentByAccessTok
|
|||||||
where: {
|
where: {
|
||||||
token,
|
token,
|
||||||
},
|
},
|
||||||
include: {
|
select: {
|
||||||
document: {
|
document: {
|
||||||
include: {
|
select: {
|
||||||
documentData: true,
|
title: true,
|
||||||
documentMeta: true,
|
documentData: {
|
||||||
|
select: {
|
||||||
|
id: true,
|
||||||
|
type: true,
|
||||||
|
data: true,
|
||||||
|
initialData: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
documentMeta: {
|
||||||
|
select: {
|
||||||
|
password: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user