mirror of
https://github.com/documenso/documenso.git
synced 2025-11-14 00:32:43 +10:00
27 lines
483 B
TypeScript
27 lines
483 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: {
|
|
Recipient: {
|
|
include: {
|
|
Field: {
|
|
include: {
|
|
Signature: true,
|
|
},
|
|
},
|
|
},
|
|
},
|
|
},
|
|
});
|
|
|
|
return document;
|
|
};
|