- updated condition for multi application for the same company and beneficiary;
This commit is contained in:
@@ -204,25 +204,28 @@ const DomandaEditInstructorManager = () => {
|
||||
setData(getFormattedData(resp.data));
|
||||
setMotivation(resp.data.motivation);
|
||||
updateFlagsForSoccorso(resp.data);
|
||||
setFormData(resp.data.applicationEvaluationFormResponse.content);
|
||||
setFormId(resp.data.applicationEvaluationFormResponse.id);
|
||||
let formDataInitial = {};
|
||||
|
||||
if (resp.data.applicationEvaluationFormResponse.formFields) {
|
||||
const submitData = resp.data.applicationEvaluationFormResponse.formFields.map((o) => ({
|
||||
fieldId: o.fieldId,
|
||||
fieldValue: o.fieldValue
|
||||
}));
|
||||
formDataInitial = submitData.reduce((acc, cur) => {
|
||||
if (cur.fieldValue) {
|
||||
acc[cur.fieldId] = cur.fieldValue;
|
||||
}
|
||||
return acc;
|
||||
}, formDataInitial);
|
||||
if (resp.data.evaluationVersion === 'V2') {
|
||||
setFormData(resp.data.applicationEvaluationFormResponse.content);
|
||||
setFormId(resp.data.applicationEvaluationFormResponse.id);
|
||||
let formDataInitial = {};
|
||||
|
||||
if (resp.data.applicationEvaluationFormResponse.formFields) {
|
||||
const submitData = resp.data.applicationEvaluationFormResponse.formFields.map((o) => ({
|
||||
fieldId: o.fieldId,
|
||||
fieldValue: o.fieldValue
|
||||
}));
|
||||
formDataInitial = submitData.reduce((acc, cur) => {
|
||||
if (cur.fieldValue) {
|
||||
acc[cur.fieldId] = cur.fieldValue;
|
||||
}
|
||||
return acc;
|
||||
}, formDataInitial);
|
||||
}
|
||||
|
||||
reset();
|
||||
setFormInitialData(formDataInitial);
|
||||
}
|
||||
|
||||
reset();
|
||||
setFormInitialData(formDataInitial);
|
||||
}
|
||||
storeSet.main.unsetAsyncRequest();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user