Skip to content

Commit

Permalink
feat: 북마크시 api 재호출
Browse files Browse the repository at this point in the history
  • Loading branch information
hyo-4 committed May 22, 2024
1 parent f1b480a commit 48449d3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/components/JD/Experience.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { Question } from "../../types/type";
import bookmarkFillIcon from "../../assets/icons/icon_bookmark_fill.svg";
import bookmarkBlankIcon from "../../assets/icons/icon_bookmark_blank.svg";
import dayjs from "dayjs";
import { KeywordType, QuestionType } from "../../types/experience";
import { QuestionType } from "../../types/experience";
import { bookmarkpatch } from "../../services/JD/bookmarkApi";
import { getCookie } from "../../services/cookie";
import { useParams } from "react-router-dom";
Expand All @@ -26,6 +26,7 @@ interface ExpProps {
detail?: QuestionType[];
checkedKeywords?: string[];
onClick?: () => void;
handleApi?: (jdid: string, token: string) => void;
}

const Experience: React.FC<ExpProps> = ({
Expand All @@ -42,6 +43,7 @@ const Experience: React.FC<ExpProps> = ({
detail,
checkedKeywords,
onClick,
handleApi,
}) => {
const [detailId, setDetailId] = useRecoilState(detailStore);
const [localbookmark, setLocalbookmark] = useState(bookmark);
Expand All @@ -68,6 +70,9 @@ const Experience: React.FC<ExpProps> = ({
try {
const response = await bookmarkpatch(token, jobId, expId);
console.log(response);
if (jdId && user.token) {
handleApi!(jdId, user.token);
}
} catch (error) {
console.error(error);
alert(JSON.stringify(error));
Expand Down
1 change: 1 addition & 0 deletions src/components/JD/ExperienceList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -468,6 +468,7 @@ const ExperienceList: React.FC<ExperienceListProps> = ({
(item: KeywordType) => item.name
)}
onClick={() => setshowDetail(true)}
handleApi={getExperienceList}
/>
))}
</ScrollDiv>
Expand Down

0 comments on commit 48449d3

Please sign in to comment.