mirror of
https://github.com/documenso/documenso.git
synced 2025-11-19 19:21:39 +10:00
feat: generate recipients and fields based on recipients
This commit is contained in:
@ -18,7 +18,7 @@ import { AppError, AppErrorCode } from '../../errors/app-error';
|
||||
import { extractLegacyIds } from '../../universal/id';
|
||||
import { type EnvelopeIdOptions } from '../../utils/envelope';
|
||||
import { mapFieldToLegacyField } from '../../utils/fields';
|
||||
import { canRecipientBeModified } from '../../utils/recipients';
|
||||
import { canRecipientBeModified, sanitizeRecipientName } from '../../utils/recipients';
|
||||
import { getEnvelopeWhereInput } from '../envelope/get-envelope-by-id';
|
||||
|
||||
export interface UpdateEnvelopeRecipientsOptions {
|
||||
@ -108,9 +108,18 @@ export const updateEnvelopeRecipients = async ({
|
||||
});
|
||||
}
|
||||
|
||||
const sanitizedUpdateData = {
|
||||
...recipient,
|
||||
...(recipient.name !== undefined
|
||||
? {
|
||||
name: sanitizeRecipientName(recipient.name),
|
||||
}
|
||||
: {}),
|
||||
};
|
||||
|
||||
return {
|
||||
originalRecipient,
|
||||
updateData: recipient,
|
||||
updateData: sanitizedUpdateData,
|
||||
};
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user