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:
David Nguyen
2025-11-15 00:46:33 +11:00
committed by GitHub
parent 5811716d12
commit dabd2564cd
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,
});
}
};