diff --git a/src/components/Candidate/Candidate.jsx b/src/components/Candidate/Candidate.jsx index 9ec8fe06..b7a4126c 100644 --- a/src/components/Candidate/Candidate.jsx +++ b/src/components/Candidate/Candidate.jsx @@ -32,7 +32,7 @@ const Candidate = () => { if (localStorage.getItem("role_status") !== "18") { return ; } - const { id: candidateId } = useParams(); + // const { id: candidateId } = useParams(); const navigate = useNavigate(); @@ -47,10 +47,10 @@ const Candidate = () => { }, []); useEffect(() => { - apiRequest(`/profile/${candidateId}`, { - params: Number(candidateId), - }).then((el) => dispatch(currentCandidate(el))); - }, [dispatch, candidateId]); + apiRequest(`/user/me`, {}).then((el) => + dispatch(currentCandidate(el.userCard)) + ); + }, [dispatch]); const { position_id, skillValues, vc_text: text } = currentCandidateObj; diff --git a/src/components/Navigation/Navigation.jsx b/src/components/Navigation/Navigation.jsx index fb83c23a..cbac4365 100644 --- a/src/components/Navigation/Navigation.jsx +++ b/src/components/Navigation/Navigation.jsx @@ -73,8 +73,8 @@ export const Navigation = () => { if (localStorage.getItem("role_status") === "18") { return; } - apiRequest(`/profile/${localStorage.getItem("cardId")}`).then( - (profileInfo) => dispatch(setProfileInfo(profileInfo)) + apiRequest(`/user/me`).then((profileInfo) => + dispatch(setProfileInfo(profileInfo.userCard)) ); }, [dispatch]); diff --git a/src/components/ProfileCalendar/ProfileCalendarComponent.jsx b/src/components/ProfileCalendar/ProfileCalendarComponent.jsx index 3a862508..d7d78bde 100644 --- a/src/components/ProfileCalendar/ProfileCalendarComponent.jsx +++ b/src/components/ProfileCalendar/ProfileCalendarComponent.jsx @@ -329,6 +329,8 @@ export const ProfileCalendarComponent = React.memo( styles={"clear-days"} onClick={() => { resetRangeDays(); + toggleActivePeriod(); + toggleRangeDays(); }} > Сбросить diff --git a/src/components/ProfileHeader/ProfileHeader.jsx b/src/components/ProfileHeader/ProfileHeader.jsx index eb592312..96daa0fe 100644 --- a/src/components/ProfileHeader/ProfileHeader.jsx +++ b/src/components/ProfileHeader/ProfileHeader.jsx @@ -26,9 +26,9 @@ export const ProfileHeader = () => { if (localStorage.getItem("role_status") === "18") { return; } - apiRequest(`/profile/${localStorage.getItem("cardId")}`).then( - (profileInfo) => dispatch(setProfileInfo(profileInfo)) - ); + apiRequest(`/user/me`).then((profileInfo) => { + dispatch(setProfileInfo(profileInfo.userCard)); + }); }, [dispatch]); const handler = () => { diff --git a/src/pages/Tracker/Tracker.jsx b/src/pages/Tracker/Tracker.jsx index 3020d102..6ec7ac93 100644 --- a/src/pages/Tracker/Tracker.jsx +++ b/src/pages/Tracker/Tracker.jsx @@ -129,7 +129,7 @@ export const Tracker = () => { e.target.closest("img").classList.toggle("open-desc-item"); e.target .closest("td") - .querySelector(".taskList__table__name-project") + ?.querySelector(".taskList__table__name-project") .classList.toggle("hide-desc"); }