chore: finalize template settings

Signed-off-by: Adithya Krishna <aadithya794@gmail.com>
This commit is contained in:
Adithya Krishna
2024-05-09 12:35:32 +05:30
parent 785b0e9085
commit 3c23624fdb
7 changed files with 169 additions and 207 deletions

View File

@ -21,6 +21,14 @@ export const upsertTemplateDocumentMeta = async ({
password,
redirectUrl,
}: CreateTemplateDocumentMetaOptions) => {
const templateDocumentMeta = await prisma.templateDocumentMeta.findFirstOrThrow({
where: {
templateId: templateId,
},
include: {
template: true,
},
});
return await prisma.$transaction(async (tx) => {
const upsertedTemplateDocumentMeta = await tx.templateDocumentMeta.upsert({
where: {