Files
sign/packages/lib/server-only/admin/get-entire-document.ts

35 lines
626 B
TypeScript
Raw Normal View History

2024-03-03 01:55:33 +11:00
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,
},
},
2024-03-03 01:55:33 +11:00
Recipient: {
include: {
Field: {
include: {
Signature: true,
},
},
},
},
},
});
return document;
};