- updated logic based on new data from API;
- updated page of archived non completed application for beneficiary; - fixed issue creating soccorso;
This commit is contained in:
@@ -22,12 +22,14 @@ import { InputNumber } from 'primereact/inputnumber';
|
||||
import BlockingOverlay from '../../components/BlockingOverlay';
|
||||
import { Toast } from 'primereact/toast';
|
||||
import { InputSwitch } from 'primereact/inputswitch';
|
||||
import ApplicationEvaluationService from '../../service/application-evaluation-service';
|
||||
|
||||
const SoccorsoEditPreInstructor = () => {
|
||||
const SoccorsoAddPreInstructor = () => {
|
||||
const isAsyncRequest = useStore().main.isAsyncRequest();
|
||||
const { id, evaluationId } = useParams();
|
||||
const { id } = useParams();
|
||||
const navigate = useNavigate();
|
||||
const [data, setData] = useState({});
|
||||
const [evaluationId, setEvaluationId] = useState(0);
|
||||
const [formData, setFormData] = useState({});
|
||||
const toast = useRef(null);
|
||||
|
||||
@@ -35,9 +37,25 @@ const SoccorsoEditPreInstructor = () => {
|
||||
navigate(`/domande/${id}`);
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
const parsed = parseInt(id)
|
||||
const entityId = !isNaN(parsed) ? parsed : 0;
|
||||
|
||||
storeSet.main.setAsyncRequest();
|
||||
ApplicationEvaluationService.getEvaluationByApplId(getCallbackEvaluation, errGetCallback, [
|
||||
['applicationId', entityId]
|
||||
]);
|
||||
}, [id]);
|
||||
|
||||
const getCallbackEvaluation = (data) => {
|
||||
if (data.status === 'SUCCESS') {
|
||||
setEvaluationId(data.data.assignedApplicationId);
|
||||
AmendmentsService.getSoccorsoByApplEvalId(data.data.assignedApplicationId, getCallback, errGetCallback)
|
||||
}
|
||||
}
|
||||
|
||||
const getCallback = (data) => {
|
||||
if (data.status === 'SUCCESS') {
|
||||
console.log(data.data)
|
||||
setData(data.data);
|
||||
setFormData(getFormattedFormData(data.data));
|
||||
}
|
||||
@@ -134,14 +152,6 @@ const SoccorsoEditPreInstructor = () => {
|
||||
storeSet.main.unsetAsyncRequest();
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
const parsed = parseInt(evaluationId)
|
||||
const entityId = !isNaN(parsed) ? parsed : 0;
|
||||
|
||||
storeSet.main.setAsyncRequest();
|
||||
AmendmentsService.getSoccorsoByApplEvalId(entityId, getCallback, errGetCallback);
|
||||
}, [evaluationId]);
|
||||
|
||||
return (
|
||||
<div className="appPage">
|
||||
<div className="appPage__pageHeader">
|
||||
@@ -297,4 +307,4 @@ const SoccorsoEditPreInstructor = () => {
|
||||
|
||||
}
|
||||
|
||||
export default SoccorsoEditPreInstructor;
|
||||
export default SoccorsoAddPreInstructor;
|
||||
Reference in New Issue
Block a user