@veloceapps/api 8.0.0-161 → 8.0.0-162
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1009,7 +1009,9 @@ class DocumentTemplatesApiService {
|
|
1009
1009
|
return zip(this.getTemplateFile(template.id), documentData$, this.resolveAttachments$(template)).pipe(switchMap(([templateFile, data, attachments]) => {
|
1010
1010
|
const document = DocxTemplater.generate(templateFile, data);
|
1011
1011
|
const properties = object?.context?.properties ?? object?.properties ?? {};
|
1012
|
-
const documentName = properties
|
1012
|
+
const documentName = template.properties?.find(({ name }) => name === 'documentName')?.value ||
|
1013
|
+
properties['Name'] ||
|
1014
|
+
template.name;
|
1013
1015
|
const documentFormat = params.documentFormat ?? template.properties?.find(p => p.name === 'documentFormat')?.value;
|
1014
1016
|
if (documentFormat === 'DOCX') {
|
1015
1017
|
this.fileDownloadService.processDownload(document, documentName);
|