fix candidate resume

This commit is contained in:
Victor Batischev 2024-04-24 19:20:21 +03:00
parent d49a2eb0c8
commit 3f46d60720
3 changed files with 19 additions and 20 deletions

View File

@ -32,7 +32,7 @@ export const Candidate = () => {
if (localStorage.getItem("role_status") !== "18") {
return <Navigate to="/profile" replace />;
}
// const { id: candidateId } = useParams();
const { id: candidateId } = useParams();
const navigate = useNavigate();
@ -47,7 +47,7 @@ export const Candidate = () => {
}, []);
useEffect(() => {
apiRequest(`/user/me`, {}).then((el) =>
apiRequest(`/resume?userId=${candidateId}`).then((el) =>
dispatch(currentCandidate(el.userCard))
);
}, [dispatch]);
@ -103,9 +103,7 @@ export const Candidate = () => {
link: "/profile/catalog"
},
{
name: `${currentCandidateObj.specification} ${
SKILLS[currentCandidateObj.position_id]
}, ${LEVELS[currentCandidateObj.level]}`,
name: `${currentCandidateObj.fio}`,
link: `/candidate/${currentCandidateObj.id}`
}
]}
@ -115,6 +113,7 @@ export const Candidate = () => {
<div className="col-12 candidate__header">
<div className="candidate__header__left">
<h3>
{currentCandidateObj.fio} &nbsp;{" "}
{currentCandidateObj.specification} &nbsp;{" "}
{SKILLS[currentCandidateObj.position_id]} &nbsp;{" "}
{LEVELS[currentCandidateObj.level]}

View File

@ -1,7 +1,7 @@
import moment from "moment/moment";
import React, { useEffect, useState } from "react";
import { useDispatch, useSelector } from "react-redux";
import { Navigate, useParams } from "react-router-dom";
import { useParams } from "react-router-dom";
import { getRequestDates, setRequestDate } from "@redux/reportSlice";

View File

@ -33,9 +33,9 @@ export const Summary = () => {
const profileInfo = useSelector(getProfileInfo);
const [openGit, setOpenGit] = useState(false);
const [gitInfo, setGitInfo] = useState([]);
const [editSummeryOpen, setEditSummeryOpen] = useState(false);
const [editSummaryOpen, setEditSummaryOpen] = useState(false);
const [editSkills, setEditSkills] = useState(false);
const [summery, setSummery] = useState("");
const [summary, setSummary] = useState("");
const [selectedSkills, setSelectedSkills] = useState([]);
const [selectSkillsOpen, setSelectSkillsOpen] = useState(false);
const [skillsList, seSkillsList] = useState([]);
@ -48,7 +48,7 @@ export const Summary = () => {
}, []);
useEffect(() => {
setSummery(profileInfo.vc_text);
setSummary(profileInfo.vc_text);
setSelectedSkills(profileInfo.skillValues);
}, [profileInfo]);
@ -69,11 +69,11 @@ export const Summary = () => {
}).then(() => {});
}
function editSummery() {
function editSummary() {
apiRequest("/resume/edit-text", {
method: "PUT",
data: {
resume: summery
resume: summary
}
}).then(() => {
showNotification({
@ -221,21 +221,21 @@ export const Summary = () => {
<div className="summary__sections__head">
<h3>Опыт работы</h3>
<button
className={editSummeryOpen ? "edit" : ""}
className={editSummaryOpen ? "edit" : ""}
onClick={() => {
if (editSummeryOpen) {
editSummery();
if (editSummaryOpen) {
editSummary();
}
setEditSummeryOpen(!editSummeryOpen);
setEditSummaryOpen(!editSummaryOpen);
}}
>
{editSummeryOpen ? "Сохранить" : "Редактировать"}
{editSummaryOpen ? "Сохранить" : "Редактировать"}
</button>
</div>
{editSummeryOpen ? (
{editSummaryOpen ? (
<CKEditor
editor={ClassicEditor}
data={summery}
data={summary}
config={{
removePlugins: [
"CKFinderUploadAdapter",
@ -252,13 +252,13 @@ export const Summary = () => {
}}
onChange={(event, editor) => {
const data = editor.getData();
setSummery(data);
setSummary(data);
}}
/>
) : (
<div
className="experience__content"
dangerouslySetInnerHTML={{ __html: summery }}
dangerouslySetInnerHTML={{ __html: summary }}
></div>
)}
</div>