- updated zustand and react libraries;
- added 'put in draft' btn;
This commit is contained in:
@@ -5,7 +5,7 @@ import { wrap } from 'object-path-immutable';
|
||||
import { useNavigate } from 'react-router-dom';
|
||||
|
||||
// store
|
||||
import { storeGet, storeSet, useStore } from '../../../../store';
|
||||
import { storeGet, storeSet, useStoreValue } from '../../../../store';
|
||||
|
||||
// tools
|
||||
import getBandoSeverity from '../../../../helpers/getBandoSeverity';
|
||||
@@ -29,9 +29,9 @@ import translationStrings from '../../../../translationStringsForComponents';
|
||||
|
||||
|
||||
const AllBandiPreferredAccordion = () => {
|
||||
const chosenCompanyId = useStore().main.chosenCompanyId();
|
||||
const companies = useStore().main.companies();
|
||||
const isAsyncRequest = useStore().main.isAsyncRequest();
|
||||
const chosenCompanyId = useStoreValue('chosenCompanyId');
|
||||
const companies = useStoreValue('companies');
|
||||
const isAsyncRequest = useStoreValue('isAsyncRequest');
|
||||
const [items, setItems] = useState(null);
|
||||
const [filters, setFilters] = useState(null);
|
||||
const [expandedRows, setExpandedRows] = useState(null);
|
||||
@@ -42,8 +42,8 @@ const AllBandiPreferredAccordion = () => {
|
||||
const existingCompany = head(companies.filter(o => o.id === chosenCompanyId));
|
||||
|
||||
if (existingCompany) {
|
||||
storeSet.main.setAsyncRequest();
|
||||
const userData = storeGet.main.userData();
|
||||
storeSet('setAsyncRequest');
|
||||
const userData = storeGet('userData');
|
||||
PreferredBandoService.getPreferredCalls(getCallback, errGetCallbacks, [
|
||||
['companyId', chosenCompanyId],
|
||||
['userId', userData.id]
|
||||
@@ -56,12 +56,12 @@ const AllBandiPreferredAccordion = () => {
|
||||
setItems(getFormattedBandiData(data.data));
|
||||
setStatuses(uniq(data.data.map(o => o.status)))
|
||||
}
|
||||
storeSet.main.unsetAsyncRequest();
|
||||
storeSet('unsetAsyncRequest');
|
||||
}
|
||||
|
||||
const errGetCallbacks = (data) => {
|
||||
set404FromErrorResponse(data);
|
||||
storeSet.main.unsetAsyncRequest();
|
||||
storeSet('unsetAsyncRequest');
|
||||
}
|
||||
|
||||
const getFormattedBandiData = (data) => {
|
||||
@@ -108,7 +108,7 @@ const AllBandiPreferredAccordion = () => {
|
||||
};
|
||||
|
||||
const addToFavourites = (id, preferredId) => {
|
||||
const companyId = storeGet.main.chosenCompanyId()
|
||||
const companyId = storeGet('chosenCompanyId')
|
||||
const data = {
|
||||
companyId,
|
||||
callId: id
|
||||
|
||||
Reference in New Issue
Block a user