mirror of
https://github.com/documenso/documenso.git
synced 2025-11-15 01:01:49 +10:00
fix: cleanup
This commit is contained in:
@ -257,7 +257,6 @@ const injectFormValuesIntoDocument = async (
|
||||
id: envelopeItem.id,
|
||||
},
|
||||
data: {
|
||||
// Todo: Envelopes [PRE-MAIN] - Should this also replace the initial data? Because if it's resealed we use the initial data thus lose the form values.
|
||||
documentDataId: newDocumentData.id,
|
||||
},
|
||||
});
|
||||
|
||||
@ -88,7 +88,7 @@ export const createEnvelopeFields = async ({
|
||||
// The item to attach the fields to MUST belong to the document.
|
||||
if (
|
||||
field.envelopeItemId &&
|
||||
!envelope.envelopeItems.find((envelopeItem) => envelopeItem.id === field.envelopeItemId) // Todo: Migration test this
|
||||
!envelope.envelopeItems.find((envelopeItem) => envelopeItem.id === field.envelopeItemId)
|
||||
) {
|
||||
throw new AppError(AppErrorCode.INVALID_REQUEST, {
|
||||
message: 'Item to attach fields to must belong to the document',
|
||||
|
||||
@ -395,7 +395,6 @@ export const createDocumentFromTemplate = async ({
|
||||
const oldEnvelopeItemToNewEnvelopeItemIdMap: Record<string, string> = {};
|
||||
|
||||
// Duplicate the envelope item data.
|
||||
// Todo: Envelopes - Ask if it's okay to just use the documentDataId? Or should it be duplicated?
|
||||
// Note: This is duplicated in createDocumentFromDirectTemplate
|
||||
const envelopeItemsToCreate = await Promise.all(
|
||||
template.envelopeItems.map(async (item, i) => {
|
||||
@ -424,9 +423,6 @@ export const createDocumentFromTemplate = async ({
|
||||
|
||||
const buffer = await getFileServerSide(documentDataToDuplicate);
|
||||
|
||||
// Todo: Envelopes [PRE-MAIN] - Should we normalize? Should be part of the upload.
|
||||
// const normalizedPdf = await makeNormalizedPdf(Buffer.from(buffer));
|
||||
|
||||
const titleToUse = item.title || finalEnvelopeTitle;
|
||||
|
||||
const duplicatedFile = await putPdfFileServerSide({
|
||||
|
||||
Reference in New Issue
Block a user