- saving progress;
This commit is contained in:
@@ -29,8 +29,8 @@ const RepeaterFields = ({ sourceId, sourceName }) => {
|
||||
return formInitialData;
|
||||
}, [formInitialData]), mode: 'onChange'
|
||||
});
|
||||
const watchName = watch('name');
|
||||
const watchFile = watch('file');
|
||||
const watchName = watch('nameValue');
|
||||
const watchFile = watch('fileValue');
|
||||
|
||||
const onSubmit = () => {
|
||||
};
|
||||
@@ -42,8 +42,8 @@ const RepeaterFields = ({ sourceId, sourceName }) => {
|
||||
}
|
||||
|
||||
const addNew = () => {
|
||||
setValue('name', '');
|
||||
setValue('file', {});
|
||||
setValue('nameValue', '');
|
||||
setValue('fileValue', {});
|
||||
trigger();
|
||||
const uid = uniqid('f');
|
||||
const newItem = {
|
||||
@@ -98,23 +98,23 @@ const RepeaterFields = ({ sourceId, sourceName }) => {
|
||||
? <div className="fieldsRepeater__fields p-panel-content">
|
||||
<FormField
|
||||
type="textinput"
|
||||
fieldName="name"
|
||||
fieldName="nameValue"
|
||||
label={__('Titolo del file', 'gepafin')}
|
||||
control={control}
|
||||
errors={errors}
|
||||
defaultValue={formInitialData['name']}
|
||||
defaultValue={formInitialData['nameValue']}
|
||||
config={{ required: __('È obbligatorio', 'gepafin') }}
|
||||
/>
|
||||
<FormField
|
||||
type="fileupload"
|
||||
setDataFn={setValue}
|
||||
saveFormCallback={doUpdateAmendment}
|
||||
fieldName="file"
|
||||
fieldName="fileValue"
|
||||
label={__('File', 'gepafin')}
|
||||
control={control}
|
||||
register={register}
|
||||
errors={errors}
|
||||
defaultValue={formInitialData['file'] ? formInitialData['file'] : []}
|
||||
defaultValue={formInitialData['fileValue'] ? formInitialData['fileValue'] : []}
|
||||
accept={[]}
|
||||
source={sourceName}
|
||||
sourceId={sourceId}
|
||||
|
||||
Reference in New Issue
Block a user