mirror of
https://github.com/documenso/documenso.git
synced 2025-11-16 01:32:06 +10:00
feat: add support for attachments in template management
- Enhanced TemplateEditForm to include attachments in the template data. - Updated createDocumentFromTemplate to handle attachment creation. - Modified updateTemplate to manage attachment updates and deletions. - Integrated attachments into ZTemplateSchema and ZAddTemplateSettingsFormSchema for validation. - Improved getTemplateById to fetch attachments alongside other template data.
This commit is contained in:
@ -136,6 +136,7 @@ export const TemplateEditForm = ({
|
||||
visibility: data.visibility,
|
||||
globalAccessAuth: data.globalAccessAuth ?? null,
|
||||
globalActionAuth: data.globalActionAuth ?? null,
|
||||
attachments: data.attachments ?? [],
|
||||
},
|
||||
meta: {
|
||||
...data.meta,
|
||||
@ -165,6 +166,14 @@ export const TemplateEditForm = ({
|
||||
await Promise.all([
|
||||
updateTemplateSettings({
|
||||
templateId: template.id,
|
||||
data: {
|
||||
attachments: template.attachments?.map((attachment) => ({
|
||||
id: attachment.id,
|
||||
label: attachment.label,
|
||||
url: attachment.url,
|
||||
formId: attachment.id,
|
||||
})),
|
||||
},
|
||||
meta: {
|
||||
signingOrder: data.signingOrder,
|
||||
allowDictateNextSigner: data.allowDictateNextSigner,
|
||||
|
||||
Reference in New Issue
Block a user