- updated zustand and react libraries;
- added 'put in draft' btn;
This commit is contained in:
@@ -7,7 +7,7 @@ import { klona } from 'klona';
|
||||
import { useForm } from 'react-hook-form';
|
||||
|
||||
// store
|
||||
import { storeSet, useStore } from '../../store';
|
||||
import { storeSet, useStoreValue } from '../../store';
|
||||
|
||||
// api
|
||||
import AmendmentsService from '../../service/amendments-service';
|
||||
@@ -31,7 +31,7 @@ import SoccorsoComunications from './components/SoccorsoComunications';
|
||||
|
||||
|
||||
const SoccorsoEditPreInstructor = () => {
|
||||
const isAsyncRequest = useStore().main.isAsyncRequest();
|
||||
const isAsyncRequest = useStoreValue('isAsyncRequest');
|
||||
const { id, amendmentId } = useParams();
|
||||
const navigate = useNavigate();
|
||||
const [data, setData] = useState({});
|
||||
@@ -76,7 +76,7 @@ const SoccorsoEditPreInstructor = () => {
|
||||
}
|
||||
setFormInitialData(formDataInitial);
|
||||
}
|
||||
storeSet.main.unsetAsyncRequest();
|
||||
storeSet('unsetAsyncRequest');
|
||||
}
|
||||
|
||||
const errGetCallback = (data) => {
|
||||
@@ -88,7 +88,7 @@ const SoccorsoEditPreInstructor = () => {
|
||||
});
|
||||
}
|
||||
set404FromErrorResponse(data);
|
||||
storeSet.main.unsetAsyncRequest();
|
||||
storeSet('unsetAsyncRequest');
|
||||
}
|
||||
|
||||
const getFormattedData = (data) => {
|
||||
@@ -152,7 +152,7 @@ const SoccorsoEditPreInstructor = () => {
|
||||
amendmentNotes: data.amendmentNotes
|
||||
}
|
||||
|
||||
storeSet.main.setAsyncRequest();
|
||||
storeSet('setAsyncRequest');
|
||||
AmendmentsService.updateSoccorso(
|
||||
amendmentId,
|
||||
submitData,
|
||||
@@ -169,7 +169,7 @@ const SoccorsoEditPreInstructor = () => {
|
||||
const submitData = {
|
||||
internalNote
|
||||
}
|
||||
storeSet.main.setAsyncRequest();
|
||||
storeSet('setAsyncRequest');
|
||||
AmendmentsService.closeSoccorso(amendmentId, submitData, closeAmendmentCallback, errCloseAmendmentCallback);
|
||||
} else {
|
||||
if (toast.current) {
|
||||
@@ -192,7 +192,7 @@ const SoccorsoEditPreInstructor = () => {
|
||||
setFormInitialData(formDataInitial);
|
||||
}
|
||||
}
|
||||
storeSet.main.unsetAsyncRequest();
|
||||
storeSet('unsetAsyncRequest');
|
||||
}
|
||||
|
||||
const errUpdateAmendmentCallback = (data) => {
|
||||
@@ -204,7 +204,7 @@ const SoccorsoEditPreInstructor = () => {
|
||||
});
|
||||
}
|
||||
set404FromErrorResponse(data);
|
||||
storeSet.main.unsetAsyncRequest();
|
||||
storeSet('unsetAsyncRequest');
|
||||
}
|
||||
|
||||
const openCloseAmendmentDialog = () => {
|
||||
@@ -247,7 +247,7 @@ const SoccorsoEditPreInstructor = () => {
|
||||
setIsVisibleCloseAmendDialog(false);
|
||||
}
|
||||
}
|
||||
storeSet.main.unsetAsyncRequest();
|
||||
storeSet('unsetAsyncRequest');
|
||||
}
|
||||
|
||||
const errCloseAmendmentCallback = (data) => {
|
||||
@@ -259,7 +259,7 @@ const SoccorsoEditPreInstructor = () => {
|
||||
});
|
||||
}
|
||||
set404FromErrorResponse(data);
|
||||
storeSet.main.unsetAsyncRequest();
|
||||
storeSet('unsetAsyncRequest');
|
||||
}
|
||||
|
||||
const headerExtendRespDialog = () => {
|
||||
|
||||
Reference in New Issue
Block a user