Files
sign/packages/lib/server-only/document/get-document-by-id.ts

20 lines
382 B
TypeScript
Raw Normal View History

2023-06-09 18:21:18 +10:00
import { prisma } from '@documenso/prisma';
export interface GetDocumentByIdOptions {
id: number;
userId: number;
}
export const getDocumentById = async ({ id, userId }: GetDocumentByIdOptions) => {
return await prisma.document.findFirstOrThrow({
where: {
id,
userId,
},
include: {
documentData: true,
documentMeta: true,
},
2023-06-09 18:21:18 +10:00
});
};