- updated zustand and react libraries;
- added 'put in draft' btn;
This commit is contained in:
@@ -7,7 +7,7 @@ import { klona } from 'klona';
|
||||
import { wrap } from 'object-path-immutable';
|
||||
|
||||
// store
|
||||
import { storeSet, useStore } from '../../store';
|
||||
import { storeSet, useStoreValue } from '../../store';
|
||||
|
||||
// api
|
||||
import AmendmentsService from '../../service/amendments-service';
|
||||
@@ -31,7 +31,7 @@ import { Editor } from 'primereact/editor';
|
||||
const APP_HUB_ID = process.env.REACT_APP_HUB_ID;
|
||||
|
||||
const SoccorsoEditBeneficiario = () => {
|
||||
const isAsyncRequest = useStore().main.isAsyncRequest();
|
||||
const isAsyncRequest = useStoreValue('isAsyncRequest');
|
||||
const { id } = useParams();
|
||||
const navigate = useNavigate();
|
||||
const [data, setData] = useState({});
|
||||
@@ -82,7 +82,7 @@ const SoccorsoEditBeneficiario = () => {
|
||||
amendmentDocuments: amendmentObj.amendmentDocuments
|
||||
}
|
||||
setFormInitialData(formDataInitial);
|
||||
storeSet.main.unsetAsyncRequest();
|
||||
storeSet('unsetAsyncRequest');
|
||||
} else {
|
||||
ApplicationService.getApplication(id, getApplCallback, errGetCallback)
|
||||
}
|
||||
@@ -98,14 +98,14 @@ const SoccorsoEditBeneficiario = () => {
|
||||
});
|
||||
}
|
||||
set404FromErrorResponse(data);
|
||||
storeSet.main.unsetAsyncRequest();
|
||||
storeSet('unsetAsyncRequest');
|
||||
}
|
||||
|
||||
const getApplCallback = (data) => {
|
||||
if (data.status === 'SUCCESS') {
|
||||
setDataAppl(getFormattedData(data.data));
|
||||
}
|
||||
storeSet.main.unsetAsyncRequest();
|
||||
storeSet('unsetAsyncRequest');
|
||||
}
|
||||
|
||||
const getFormattedData = (data) => {
|
||||
@@ -146,7 +146,7 @@ const SoccorsoEditBeneficiario = () => {
|
||||
}
|
||||
const amendmentId = data.id;
|
||||
|
||||
storeSet.main.setAsyncRequest();
|
||||
storeSet('setAsyncRequest');
|
||||
|
||||
AmendmentsService.updateSoccorso(
|
||||
amendmentId,
|
||||
@@ -189,7 +189,7 @@ const SoccorsoEditBeneficiario = () => {
|
||||
setFormInitialData(formDataInitial);
|
||||
}
|
||||
}
|
||||
storeSet.main.unsetAsyncRequest();
|
||||
storeSet('unsetAsyncRequest');
|
||||
}
|
||||
|
||||
const errUpdateAmendmentCallback = (data) => {
|
||||
@@ -201,7 +201,7 @@ const SoccorsoEditBeneficiario = () => {
|
||||
});
|
||||
}
|
||||
//set404FromErrorResponse(data);
|
||||
storeSet.main.unsetAsyncRequest();
|
||||
storeSet('unsetAsyncRequest');
|
||||
}
|
||||
|
||||
const updateNewAmendmentData = (value, path) => {
|
||||
|
||||
Reference in New Issue
Block a user