- updated special amendment submitting;
This commit is contained in:
@@ -789,7 +789,7 @@ const DomandaEditPreInstructor = () => {
|
|||||||
<Button
|
<Button
|
||||||
type="button"
|
type="button"
|
||||||
disabled={loading}
|
disabled={loading}
|
||||||
label={__('Invia', 'gepafin')} onClick={hidePreTecEvalDialog}/>
|
label={__('Invia', 'gepafin')} onClick={doCreateSpecialAmendment}/>
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -845,6 +845,48 @@ const DomandaEditPreInstructor = () => {
|
|||||||
storeSet('unsetAsyncRequest');
|
storeSet('unsetAsyncRequest');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const doCreateSpecialAmendment = useCallback(() => {
|
||||||
|
if (
|
||||||
|
!isEmpty(preTecEvalData.amount) && !isEmpty(preTecEvalData.pec) && !isEmpty(preTecEvalData.amendmentDocumentType)
|
||||||
|
) {
|
||||||
|
storeSet('setAsyncRequest');
|
||||||
|
|
||||||
|
AmendmentsService.createAmendmentSpecial(preTecEvalData, getAmendmentSpecialCallback, errGetAmendmentSpecialCallback,
|
||||||
|
[
|
||||||
|
['applicationEvaluationId', data.id]
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}, [preTecEvalData, data]);
|
||||||
|
|
||||||
|
const getAmendmentSpecialCallback = (data) => {
|
||||||
|
if (data.status === 'SUCCESS') {
|
||||||
|
if (toast.current && data.message) {
|
||||||
|
toast.current.show({
|
||||||
|
severity: 'success',
|
||||||
|
summary: '',
|
||||||
|
detail: data.message
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
setIsVisiblePreTecEvalDialog(false);
|
||||||
|
setPreTecEvalData({});
|
||||||
|
storeSet('unsetAsyncRequest');
|
||||||
|
}
|
||||||
|
|
||||||
|
const errGetAmendmentSpecialCallback = (data) => {
|
||||||
|
if (toast.current && data.message) {
|
||||||
|
toast.current.show({
|
||||||
|
severity: data.status === 'SUCCESS' ? 'info' : 'error',
|
||||||
|
summary: '',
|
||||||
|
detail: data.message
|
||||||
|
});
|
||||||
|
}
|
||||||
|
setIsVisiblePreTecEvalDialog(false);
|
||||||
|
setPreTecEvalData({});
|
||||||
|
set404FromErrorResponse(data);
|
||||||
|
storeSet('unsetAsyncRequest');
|
||||||
|
}
|
||||||
|
|
||||||
const doMakeAdmisible = () => {
|
const doMakeAdmisible = () => {
|
||||||
doSaveDraft(null, {
|
doSaveDraft(null, {
|
||||||
applicationStatus: 'ADMISSIBLE'
|
applicationStatus: 'ADMISSIBLE'
|
||||||
|
|||||||
@@ -42,6 +42,10 @@ export default class AmendmentsService {
|
|||||||
]);
|
]);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static createAmendmentSpecial = (body, callback, errCallback, queryParams) => {
|
||||||
|
NetworkService.post(`${API_BASE_URL}/amendments/special`, body, callback, errCallback, queryParams);
|
||||||
|
};
|
||||||
|
|
||||||
static sendReminderForSoccorso = (id, callback, errCallback, queryParams) => {
|
static sendReminderForSoccorso = (id, callback, errCallback, queryParams) => {
|
||||||
NetworkService.post(`${API_BASE_URL}/amendments/${id}/reminder`, {}, callback, errCallback, queryParams);
|
NetworkService.post(`${API_BASE_URL}/amendments/${id}/reminder`, {}, callback, errCallback, queryParams);
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user