mirror of
https://github.com/documenso/documenso.git
synced 2025-11-18 18:51:37 +10:00
feat: add ability to change field recipient
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