mirror of
https://github.com/documenso/documenso.git
synced 2025-11-17 02:01:33 +10:00
feat: add template meta for templates
Signed-off-by: Adithya Krishna <aadithya794@gmail.com>
This commit is contained in:
@ -42,6 +42,7 @@ export const createDocumentFromTemplate = async ({
|
||||
Recipient: true,
|
||||
Field: true,
|
||||
templateDocumentData: true,
|
||||
templateDocumentMeta: true,
|
||||
},
|
||||
});
|
||||
|
||||
@ -57,12 +58,24 @@ export const createDocumentFromTemplate = async ({
|
||||
},
|
||||
});
|
||||
|
||||
// const templateDocumentMeta = await prisma.documentMeta.create({
|
||||
// data: {
|
||||
// subject: template.templateDocumentMeta.subject,
|
||||
// message: template.templateDocumentMeta.message,
|
||||
// timezone: template.templateDocumentMeta.timezone,
|
||||
// password: template.templateDocumentMeta.password,
|
||||
// dateFormat: template.templateDocumentMeta.dateFormat,
|
||||
// redirectUrl: template.templateDocumentMeta.redirectUrl,
|
||||
// },
|
||||
// });
|
||||
|
||||
const document = await prisma.document.create({
|
||||
data: {
|
||||
userId,
|
||||
teamId: template.teamId,
|
||||
title: template.title,
|
||||
documentDataId: documentData.id,
|
||||
// documentMeta: templateDocumentMeta,
|
||||
Recipient: {
|
||||
create: template.Recipient.map((recipient) => ({
|
||||
email: recipient.email,
|
||||
|
||||
@ -38,6 +38,7 @@ export const duplicateTemplate = async ({
|
||||
Recipient: true,
|
||||
Field: true,
|
||||
templateDocumentData: true,
|
||||
templateDocumentMeta: true,
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
@ -37,6 +37,7 @@ export const findTemplates = async ({
|
||||
where: whereFilter,
|
||||
include: {
|
||||
templateDocumentData: true,
|
||||
templateDocumentMeta: true,
|
||||
team: {
|
||||
select: {
|
||||
id: true,
|
||||
|
||||
@ -29,6 +29,7 @@ export const getTemplateById = async ({ id, userId }: GetTemplateByIdOptions) =>
|
||||
where: whereFilter,
|
||||
include: {
|
||||
templateDocumentData: true,
|
||||
templateDocumentMeta: true,
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user