mirror of
https://github.com/documenso/documenso.git
synced 2025-11-25 06:01:35 +10:00
chore: fix seal document handler
This commit is contained in:
@ -123,21 +123,36 @@ export const run = async ({
|
|||||||
|
|
||||||
const pdfData = await getFile(documentData);
|
const pdfData = await getFile(documentData);
|
||||||
|
|
||||||
const certificateData =
|
let includeSigningCertificate;
|
||||||
(document.team?.teamGlobalSettings?.includeSigningCertificate ?? true)
|
|
||||||
? await getCertificatePdf({
|
|
||||||
documentId,
|
|
||||||
language: document.documentMeta?.language,
|
|
||||||
}).catch(() => null)
|
|
||||||
: null;
|
|
||||||
|
|
||||||
const auditLogData =
|
if (document.teamId) {
|
||||||
(document.team?.teamGlobalSettings?.includeAuditTrailLog ?? true)
|
includeSigningCertificate =
|
||||||
? await getAuditLogsPdf({
|
document.team?.teamGlobalSettings?.includeSigningCertificate ?? true;
|
||||||
documentId,
|
} else {
|
||||||
language: document.documentMeta?.language,
|
includeSigningCertificate = document.includeSigningCertificate ?? true;
|
||||||
}).catch(() => null)
|
}
|
||||||
: null;
|
|
||||||
|
const certificateData = includeSigningCertificate
|
||||||
|
? await getCertificatePdf({
|
||||||
|
documentId,
|
||||||
|
language: document.documentMeta?.language,
|
||||||
|
}).catch(() => null)
|
||||||
|
: null;
|
||||||
|
|
||||||
|
let includeAuditTrailLog;
|
||||||
|
|
||||||
|
if (document.teamId) {
|
||||||
|
includeAuditTrailLog = document.team?.teamGlobalSettings?.includeAuditTrailLog ?? true;
|
||||||
|
} else {
|
||||||
|
includeAuditTrailLog = document.includeAuditTrailLog ?? true;
|
||||||
|
}
|
||||||
|
|
||||||
|
const auditLogData = includeAuditTrailLog
|
||||||
|
? await getAuditLogsPdf({
|
||||||
|
documentId,
|
||||||
|
language: document.documentMeta?.language,
|
||||||
|
}).catch(() => null)
|
||||||
|
: null;
|
||||||
|
|
||||||
const newDataId = await io.runTask('decorate-and-sign-pdf', async () => {
|
const newDataId = await io.runTask('decorate-and-sign-pdf', async () => {
|
||||||
const pdfDoc = await PDFDocument.load(pdfData);
|
const pdfDoc = await PDFDocument.load(pdfData);
|
||||||
|
|||||||
Reference in New Issue
Block a user