- updated zustand and react libraries;

- added 'put in draft' btn;
This commit is contained in:
Vitalii Kiiko
2025-04-10 12:36:19 +02:00
parent 44ba9036cb
commit 7dcf932819
90 changed files with 677 additions and 587 deletions

View File

@@ -57,7 +57,7 @@ const BandoForms = () => {
const selectedFormArr = forms.filter(o => o.value === selectedForDuplicateForm);
if (!isEmpty(selectedFormArr)) {
storeSet.main.setAsyncRequest();
storeSet('setAsyncRequest');
FormsService.getFormById(selectedForDuplicateForm, getFormDuplicateCallback, errGetFormDuplicateCallbacks);
}
}
@@ -81,17 +81,17 @@ const BandoForms = () => {
errFormCreateCallback
);
}
storeSet.main.unsetAsyncRequest();
storeSet('unsetAsyncRequest');
}
const errGetFormDuplicateCallbacks = (data) => {
set404FromErrorResponse(data);
storeSet.main.unsetAsyncRequest();
storeSet('unsetAsyncRequest');
}
const formCreateCallback = (data) => {
if (data.status === 'SUCCESS') {
storeSet.main.unsetAsyncRequest();
storeSet('unsetAsyncRequest');
if (toast.current) {
toast.current.show({
@@ -108,7 +108,7 @@ const BandoForms = () => {
}
const errFormCreateCallback = (data) => {
storeSet.main.unsetAsyncRequest();
storeSet('unsetAsyncRequest');
if (toast.current) {
toast.current.show({
severity: 'error',
@@ -126,12 +126,12 @@ const BandoForms = () => {
if (data.status === 'SUCCESS') {
setBandoStatus(data.data.status);
}
storeSet.main.unsetAsyncRequest();
storeSet('unsetAsyncRequest');
}
const errGetCallback = (data) => {
set404FromErrorResponse(data);
storeSet.main.unsetAsyncRequest();
storeSet('unsetAsyncRequest');
}
const getFormsCallback = (data) => {
@@ -139,12 +139,12 @@ const BandoForms = () => {
const forms = data.data.map(o => ({ label: o.label, value: o.id }))
setForms(forms);
}
storeSet.main.unsetAsyncRequest();
storeSet('unsetAsyncRequest');
}
const errGetFormsCallback = (data) => {
set404FromErrorResponse(data);
storeSet.main.unsetAsyncRequest();
storeSet('unsetAsyncRequest');
}
const getAllBandiCallback = (data) => {
@@ -171,7 +171,7 @@ const BandoForms = () => {
const doDuplicateFormOfAnotherBando = () => {
if (selectedBandoIdForDuplicate !== 0 && selectedFormIdForDuplicate !== 0) {
storeSet.main.setAsyncRequest();
storeSet('setAsyncRequest');
FormsService.getFormById(selectedFormIdForDuplicate, getFormDuplicateCallback, errGetFormDuplicateCallbacks);
}
}
@@ -187,7 +187,7 @@ const BandoForms = () => {
const parsed = parseInt(id)
const bandoId = !isNaN(parsed) ? parsed : 0;
storeSet.main.setAsyncRequest();
storeSet('setAsyncRequest');
BandoService.getBando(id, getCallback, errGetCallback);
FormsService.getFormsForCall(bandoId, getFormsCallback, errGetFormsCallback);