- updated zustand and react libraries;
- added 'put in draft' btn;
This commit is contained in:
@@ -5,7 +5,7 @@ import { head, is, isEmpty, isNil } from 'ramda';
|
||||
import 'quill/dist/quill.core.css';
|
||||
|
||||
// store
|
||||
import { storeGet, storeSet, useStore } from '../../store';
|
||||
import { storeGet, storeSet, useStoreValue } from '../../store';
|
||||
|
||||
// tools
|
||||
import getNumberWithCurrency from '../../helpers/getNumberWithCurrency';
|
||||
@@ -34,8 +34,8 @@ import { Dialog } from 'primereact/dialog';
|
||||
const REACT_APP_HUB_ID = process.env.REACT_APP_HUB_ID;
|
||||
|
||||
const BandoViewBeneficiario = () => {
|
||||
const isAsyncRequest = useStore().main.isAsyncRequest();
|
||||
const chosenCompanyId = useStore().main.chosenCompanyId();
|
||||
const isAsyncRequest = useStoreValue('isAsyncRequest');
|
||||
const chosenCompanyId = useStoreValue('chosenCompanyId');
|
||||
const { id } = useParams();
|
||||
const navigate = useNavigate();
|
||||
const [data, setData] = useState({});
|
||||
@@ -73,7 +73,7 @@ const BandoViewBeneficiario = () => {
|
||||
document.body.appendChild(link);
|
||||
link.click();
|
||||
link.remove();
|
||||
storeSet.main.unsetAsyncRequest();
|
||||
storeSet('unsetAsyncRequest');
|
||||
}
|
||||
|
||||
const errCallPdfCallback = (data) => {
|
||||
@@ -84,7 +84,7 @@ const BandoViewBeneficiario = () => {
|
||||
detail: data.message
|
||||
});
|
||||
}
|
||||
storeSet.main.unsetAsyncRequest();
|
||||
storeSet('unsetAsyncRequest');
|
||||
}
|
||||
|
||||
const getBandoId = () => {
|
||||
@@ -144,7 +144,7 @@ const BandoViewBeneficiario = () => {
|
||||
}
|
||||
|
||||
const createApplCallback = (data) => {
|
||||
storeSet.main.unsetAsyncRequest();
|
||||
storeSet('unsetAsyncRequest');
|
||||
if (data.status === 'SUCCESS') {
|
||||
navigate(`/imieibandi/${data.data.id}`);
|
||||
}
|
||||
@@ -167,7 +167,7 @@ const BandoViewBeneficiario = () => {
|
||||
}
|
||||
]);
|
||||
}
|
||||
storeSet.main.unsetAsyncRequest();
|
||||
storeSet('unsetAsyncRequest');
|
||||
}
|
||||
|
||||
/*const saveToFavourites = () => {
|
||||
@@ -187,7 +187,7 @@ const BandoViewBeneficiario = () => {
|
||||
'response': '',
|
||||
'isVisible': false
|
||||
}
|
||||
storeSet.main.setAsyncRequest();
|
||||
storeSet('setAsyncRequest');
|
||||
FaqItemService.addQuestion(id, obj, createQuestionBack, errCreateQuestionCallback, [['companyId', chosenCompanyId]])
|
||||
}
|
||||
}
|
||||
@@ -203,7 +203,7 @@ const BandoViewBeneficiario = () => {
|
||||
});
|
||||
}
|
||||
}
|
||||
storeSet.main.unsetAsyncRequest();
|
||||
storeSet('unsetAsyncRequest');
|
||||
}
|
||||
|
||||
const errCreateQuestionCallback = (data) => {
|
||||
@@ -214,14 +214,14 @@ const BandoViewBeneficiario = () => {
|
||||
detail: data.message
|
||||
});
|
||||
}
|
||||
storeSet.main.unsetAsyncRequest();
|
||||
storeSet('unsetAsyncRequest');
|
||||
}
|
||||
|
||||
const getBandoCallback = (data) => {
|
||||
if (data.status === 'SUCCESS') {
|
||||
setData(getFormattedBandiData(data.data));
|
||||
}
|
||||
storeSet.main.unsetAsyncRequest();
|
||||
storeSet('unsetAsyncRequest');
|
||||
}
|
||||
|
||||
const errGetBandoCallback = (data) => {
|
||||
@@ -233,7 +233,7 @@ const BandoViewBeneficiario = () => {
|
||||
});
|
||||
}
|
||||
set404FromErrorResponse(data);
|
||||
storeSet.main.unsetAsyncRequest();
|
||||
storeSet('unsetAsyncRequest');
|
||||
}
|
||||
|
||||
const getFormattedBandiData = (data) => {
|
||||
@@ -250,12 +250,12 @@ const BandoViewBeneficiario = () => {
|
||||
}
|
||||
}
|
||||
}
|
||||
storeSet.main.unsetAsyncRequest();
|
||||
storeSet('unsetAsyncRequest');
|
||||
}
|
||||
|
||||
const errGetApplCallback = (data) => {
|
||||
set404FromErrorResponse(data);
|
||||
storeSet.main.unsetAsyncRequest();
|
||||
storeSet('unsetAsyncRequest');
|
||||
}
|
||||
|
||||
const renderHeader = () => {
|
||||
@@ -279,7 +279,7 @@ const BandoViewBeneficiario = () => {
|
||||
const header = renderHeader();
|
||||
|
||||
const addToFavourites = () => {
|
||||
const companyId = storeGet.main.chosenCompanyId();
|
||||
const companyId = storeGet('chosenCompanyId');
|
||||
const bandoId = getBandoId();
|
||||
const formdData = {
|
||||
companyId,
|
||||
@@ -318,12 +318,12 @@ const BandoViewBeneficiario = () => {
|
||||
useEffect(() => {
|
||||
if (!isEmpty(chosenCompanyId) && chosenCompanyId !== 0) {
|
||||
const bandoId = getBandoId();
|
||||
storeSet.main.setAsyncRequest();
|
||||
storeSet('setAsyncRequest');
|
||||
BandoService.getBando(bandoId, getBandoCallback, errGetBandoCallback, [
|
||||
['companyId', chosenCompanyId]
|
||||
]);
|
||||
if (REACT_APP_HUB_ID !== 't7jh5wfg9QXylNaTZkPoE') {
|
||||
storeSet.main.setAsyncRequest();
|
||||
storeSet('setAsyncRequest');
|
||||
setApplicationObj(true);
|
||||
ApplicationService.getApplications(getApplCallback, errGetApplCallback, [
|
||||
['callId', bandoId],
|
||||
|
||||
Reference in New Issue
Block a user