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

19 lines
364 B
TypeScript
Raw Normal View History

2023-10-06 22:54:24 +00:00
import { prisma } from '@documenso/prisma';
export interface GetTemplateByIdOptions {
id: number;
userId: number;
}
export const getTemplateById = async ({ id, userId }: GetTemplateByIdOptions) => {
return await prisma.template.findFirstOrThrow({
where: {
id,
userId,
},
include: {
templateDocumentData: true,
},
});
};