mirror of
https://github.com/documenso/documenso.git
synced 2025-11-12 07:43:16 +10:00
19 lines
356 B
TypeScript
19 lines
356 B
TypeScript
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,
|
|
},
|
|
});
|
|
};
|