feat: add ability to change field recipient

This commit is contained in:
David Nguyen
2025-11-14 16:35:33 +11:00
parent 5811716d12
commit 45be6351d1
4 changed files with 400 additions and 35 deletions

View File

@ -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,
});
}
};