mirror of
https://github.com/documenso/documenso.git
synced 2025-11-16 01:32:06 +10:00
feat: add ability to change field recipient (#2194)
## Description Add ability to change recipients for a given field. <img width="336" height="224" alt="image" src="https://github.com/user-attachments/assets/c122672d-68ab-4652-9c76-1a1bc874c16a" /> <img width="716" height="465" alt="image" src="https://github.com/user-attachments/assets/a8e8636c-c780-4d56-910b-5522161b12d3" />
This commit is contained in:
@ -170,10 +170,15 @@ export const useEditorFields = ({
|
||||
);
|
||||
|
||||
const setFieldId = (formId: string, id: number) => {
|
||||
const index = localFields.findIndex((field) => field.formId === formId);
|
||||
const { fields } = form.getValues();
|
||||
|
||||
const index = fields.findIndex((field) => field.formId === formId);
|
||||
|
||||
if (index !== -1) {
|
||||
form.setValue(`fields.${index}.id`, id);
|
||||
update(index, {
|
||||
...fields[index],
|
||||
id,
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user