logout fixes with role redirect

This commit is contained in:
kurpfish
2021-08-20 17:33:29 +03:00
parent 8cce68ce06
commit 7891dccb59
14 changed files with 89 additions and 29 deletions

View File

@ -5,8 +5,12 @@ import { Loader } from '../Loader/Loader';
import style from './TagSelect.module.css';
import { selectedItems, selectItems, selectTags, filteredCandidates, setPositionId } from '../../redux/outstaffingSlice';
import { fetchItemsForId } from '../../server/server';
import { useHistory } from 'react-router-dom';
import { getRole } from '../../redux/roleSlice';
const TagSelect = () => {
const history = useHistory;
const role = useSelector(getRole);
const [searchLoading, setSearchLoading] = useState(false);
const dispatch = useDispatch();
@ -20,7 +24,7 @@ const TagSelect = () => {
dispatch(setPositionId(null));
const filterItemsId = itemsArr.map((item) => item.id).join();
fetchItemsForId(`${process.env.REACT_APP_API_URL}/api/profile?skills=`, filterItemsId).then((el) => {
fetchItemsForId({ link: `${process.env.REACT_APP_API_URL}/api/profile?skills=`, index: filterItemsId, history, role, }).then((el) => {
dispatch(filteredCandidates(el))
setSearchLoading(false)
});