mirror of
https://github.com/documenso/documenso.git
synced 2025-11-16 17:51:49 +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,
|
append: appendSigner,
|
||||||
fields: signers,
|
fields: signers,
|
||||||
remove: removeSigner,
|
remove: removeSigner,
|
||||||
|
update: updateSigner,
|
||||||
} = useFieldArray({
|
} = useFieldArray({
|
||||||
control,
|
control,
|
||||||
name: 'signers',
|
name: 'signers',
|
||||||
@ -97,7 +98,15 @@ export const AddTemplatePlaceholderRecipientsFormPartial = ({
|
|||||||
};
|
};
|
||||||
|
|
||||||
const onRemoveSigner = (index: number) => {
|
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);
|
removeSigner(index);
|
||||||
|
setPlaceholderRecipientCount((count) => count - 1);
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
Reference in New Issue
Block a user