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

35 lines
628 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,
2025-01-13 13:41:53 +11:00
user: {
select: {
id: true,
name: true,
email: true,
},
},
2025-01-13 13:41:53 +11:00
recipients: {
2024-03-03 01:55:33 +11:00
include: {
2025-01-13 13:41:53 +11:00
fields: {
2024-03-03 01:55:33 +11:00
include: {
2025-01-13 13:41:53 +11:00
signature: true,
2024-03-03 01:55:33 +11:00
},
},
},
},
},
});
return document;
};