diff --git a/src/components/Candidate/Candidate.js b/src/components/Candidate/Candidate.js
index af9c9415..8be534d8 100644
--- a/src/components/Candidate/Candidate.js
+++ b/src/components/Candidate/Candidate.js
@@ -1,7 +1,12 @@
import React from 'react';
import { useHistory, useParams } from 'react-router-dom';
import { useSelector, useDispatch } from 'react-redux';
-import { currentCandidate, selectCurrentCandidate, selectProfiles } from '../../redux/outstaffingSlice';
+import {
+ currentCandidate,
+ selectCurrentCandidate,
+ selectProfiles,
+ selectFilteredCandidates,
+} from '../../redux/outstaffingSlice';
import style from './Candidate.module.css';
import arrow from '../../images/right-arrow.png';
import rectangle from '../../images/rectangle_secondPage.png';
@@ -18,14 +23,21 @@ const Candidate = () => {
const dispatch = useDispatch();
const candidatesArr = useSelector(selectProfiles);
+ const filteredCandidates = useSelector(selectFilteredCandidates);
- dispatch(currentCandidate(candidatesArr.find((el) => Number(el.id) === Number(candidateId))));
+ dispatch(
+ currentCandidate(
+ filteredCandidates.length > 0
+ ? filteredCandidates.find((el) => Number(el.id) === Number(candidateId))
+ : candidatesArr.find((el) => Number(el.id) === Number(candidateId))
+ )
+ );
const currentCandidateObj = useSelector(selectCurrentCandidate);
console.log('currentCandidateObj ', currentCandidateObj);
- const { fio: name, position_id, skillValues, vc_text: text } = currentCandidateObj;
+ const { position_id, skillValues, vc_text: text } = currentCandidateObj;
let classes;
let header;
@@ -88,7 +100,6 @@ const Candidate = () => {
-
{name}
# Описание опыта
{text ? (
@@ -96,7 +107,7 @@ const Candidate = () => {
) : (
Описание отсутствует...
)}
-
- {el.fio} разработчик, {LEVELS[el.level]}
+ {SKILLS[el.position_id]}, {LEVELS[el.level]}
{el.vc_text ? (
@@ -60,7 +60,7 @@ const Description = ({ onLoadMore }) => {
- {el.fio} разработчик, {LEVELS[el.level]}
+ {SKILLS[el.position_id]}, {LEVELS[el.level]}
{el.vc_text ? (
diff --git a/src/components/Select/TagSelect.js b/src/components/Select/TagSelect.js
index db0f9f11..85fd2a94 100644
--- a/src/components/Select/TagSelect.js
+++ b/src/components/Select/TagSelect.js
@@ -19,7 +19,7 @@ const TagSelect = () => {
dispatch(filteredCandidates(el))
);
- dispatch(selectedItems([]));
+ // dispatch(selectedItems([]));
};
return (
diff --git a/src/components/constants/constants.js b/src/components/constants/constants.js
index 3b72d176..e8918c47 100644
--- a/src/components/constants/constants.js
+++ b/src/components/constants/constants.js
@@ -4,3 +4,12 @@ export const LEVELS = {
3: 'Middle+',
4: 'Senior',
};
+
+export const SKILLS = {
+ 1: 'Back end - разработчик',
+ 2: 'Front end - разработчик',
+ 3: 'Маркетолог',
+ 4: 'Smm - специалист',
+ 5: 'Дизайнер',
+ 6: 'Копирайтер',
+};