From f153dc6def524ccaa809455e6a04abedd726e7e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9D=B4=ED=9A=A8=EC=9B=90?= Date: Mon, 20 May 2024 05:12:22 +0900 Subject: [PATCH 01/17] =?UTF-8?q?feat:=20=EA=B2=BD=ED=97=98=20=EC=83=81?= =?UTF-8?q?=EC=84=B8=20=EC=A1=B0=ED=9A=8C=20API=20=EC=97=B0=EB=8F=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/ExperienceDetailPage.tsx | 33 +++++++++++++++--------- src/services/Experience/experienceApi.ts | 9 +++++++ src/types/experience.ts | 4 +++ 3 files changed, 34 insertions(+), 12 deletions(-) diff --git a/src/pages/ExperienceDetailPage.tsx b/src/pages/ExperienceDetailPage.tsx index 4e25922..07ba08e 100644 --- a/src/pages/ExperienceDetailPage.tsx +++ b/src/pages/ExperienceDetailPage.tsx @@ -8,19 +8,27 @@ import ExpData from "../services/JD/ExpData"; import { questions } from "../assets/data/questions"; import Chip from "../components/common/Chip"; import Textarea from "../components/common/Textarea"; +import { getExperience } from "../services/Experience/experienceApi"; +import { ExperienceDetailType } from "../types/experience"; +import { getCookie } from "../services/cookie"; const ExperienceDetailPage = () => { + const user = getCookie("user"); const navigate = useNavigate(); const theme = useTheme(); + const [expData, setExpData] = React.useState(); + const expKeywords = expData?.strongPointIds?.map((item) => item.name) || []; const { id } = useParams(); React.useEffect(() => { - window.scrollTo({ - top: 0, - behavior: "auto", - }); - }, []); + if (id) { + getExperience(id, user?.token).then((res) => { + console.log(res); + setExpData(res.data); + }); + } + }, [id, user?.token]); return ( @@ -43,22 +51,23 @@ const ExperienceDetailPage = () => {
- {questions.map((item, index) => ( + {expData?.contents?.map((item, index) => (
- +