mirror of
https://github.com/documenso/documenso.git
synced 2025-11-16 09:41:35 +10:00
chore: fix ordering of recipients
Signed-off-by: Adithya Krishna <aadithya794@gmail.com>
This commit is contained in:
@ -80,6 +80,7 @@ export const AddTemplatePlaceholderRecipientsFormPartial = ({
|
||||
append: appendSigner,
|
||||
fields: signers,
|
||||
remove: removeSigner,
|
||||
update: updateSigner,
|
||||
} = useFieldArray({
|
||||
control,
|
||||
name: 'signers',
|
||||
@ -97,7 +98,15 @@ export const AddTemplatePlaceholderRecipientsFormPartial = ({
|
||||
};
|
||||
|
||||
const onRemoveSigner = (index: number) => {
|
||||
for (let i = index; i < signers.length; i++) {
|
||||
updateSigner(i, {
|
||||
...signers[i],
|
||||
name: `Recipient ${i}`,
|
||||
email: `recipient.${i}@documenso.com`,
|
||||
});
|
||||
}
|
||||
removeSigner(index);
|
||||
setPlaceholderRecipientCount((count) => count - 1);
|
||||
};
|
||||
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user