mirror of
https://github.com/documenso/documenso.git
synced 2025-11-13 00:03:33 +10:00
35 lines
628 B
TypeScript
35 lines
628 B
TypeScript
import { prisma } from '@documenso/prisma';
|
|
|
|
export type GetEntireDocumentOptions = {
|
|
id: number;
|
|
};
|
|
|
|
export const getEntireDocument = async ({ id }: GetEntireDocumentOptions) => {
|
|
const document = await prisma.document.findFirstOrThrow({
|
|
where: {
|
|
id,
|
|
},
|
|
include: {
|
|
documentMeta: true,
|
|
user: {
|
|
select: {
|
|
id: true,
|
|
name: true,
|
|
email: true,
|
|
},
|
|
},
|
|
recipients: {
|
|
include: {
|
|
fields: {
|
|
include: {
|
|
signature: true,
|
|
},
|
|
},
|
|
},
|
|
},
|
|
},
|
|
});
|
|
|
|
return document;
|
|
};
|