mirror of
https://github.com/documenso/documenso.git
synced 2025-11-14 08:42:12 +10:00
chore: revert changes based on feedback
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
import type { Attachment, DocumentVisibility, Template, TemplateMeta } from '@prisma/client';
|
||||
import type { DocumentVisibility, Template, TemplateMeta } from '@prisma/client';
|
||||
|
||||
import { prisma } from '@documenso/prisma';
|
||||
|
||||
@ -21,7 +21,6 @@ export type UpdateTemplateOptions = {
|
||||
publicDescription?: string;
|
||||
type?: Template['type'];
|
||||
useLegacyFieldInsertion?: boolean;
|
||||
attachments?: Pick<Attachment, 'id' | 'label' | 'url'>[];
|
||||
};
|
||||
meta?: Partial<Omit<TemplateMeta, 'id' | 'templateId'>>;
|
||||
};
|
||||
@ -40,7 +39,6 @@ export const updateTemplate = async ({
|
||||
},
|
||||
include: {
|
||||
templateMeta: true,
|
||||
attachments: true,
|
||||
team: {
|
||||
select: {
|
||||
organisation: {
|
||||
@ -100,29 +98,6 @@ export const updateTemplate = async ({
|
||||
publicDescription: data?.publicDescription,
|
||||
publicTitle: data?.publicTitle,
|
||||
useLegacyFieldInsertion: data?.useLegacyFieldInsertion,
|
||||
attachments: {
|
||||
deleteMany: {
|
||||
templateId,
|
||||
id: {
|
||||
notIn: data?.attachments?.map((attachment) => attachment.id),
|
||||
},
|
||||
},
|
||||
upsert: data?.attachments?.map((attachment) => ({
|
||||
where: {
|
||||
id: attachment.id,
|
||||
templateId,
|
||||
},
|
||||
update: {
|
||||
label: attachment.label,
|
||||
url: attachment.url,
|
||||
},
|
||||
create: {
|
||||
id: attachment.id,
|
||||
label: attachment.label,
|
||||
url: attachment.url,
|
||||
},
|
||||
})),
|
||||
},
|
||||
authOptions,
|
||||
templateMeta: {
|
||||
upsert: {
|
||||
|
||||
Reference in New Issue
Block a user