mirror of
https://github.com/documenso/documenso.git
synced 2025-11-13 16:23:06 +10:00
21 lines
472 B
TypeScript
21 lines
472 B
TypeScript
import { prisma } from '@documenso/prisma';
|
|
import { TCreateTemplateMutationSchema } from '@documenso/trpc/server/template-router/schema';
|
|
|
|
export type CreateTemplateOptions = TCreateTemplateMutationSchema & {
|
|
userId: number;
|
|
};
|
|
|
|
export const createTemplate = async ({
|
|
title,
|
|
userId,
|
|
templateDocumentDataId,
|
|
}: CreateTemplateOptions) => {
|
|
return await prisma.template.create({
|
|
data: {
|
|
title,
|
|
userId,
|
|
templateDocumentDataId,
|
|
},
|
|
});
|
|
};
|