Skip to content

Commit

Permalink
Merge pull request #149 from KUSITMS-29th-TEAM-B/feat/#101
Browse files Browse the repository at this point in the history
Feat/#101
  • Loading branch information
hyo-4 committed May 22, 2024
2 parents cc24a5b + 3ac9118 commit ab143ce
Show file tree
Hide file tree
Showing 8 changed files with 234 additions and 253 deletions.
2 changes: 1 addition & 1 deletion src/components/JD/ContentInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ const Content = styled.textarea`
outline: none;
resize: none;
padding: 0.5rem;
font-size: 1rem;
font-size: 14px;
font-size: 0.8125rem;
font-style: normal;
font-weight: 400;
Expand Down
24 changes: 22 additions & 2 deletions src/components/JD/Experience.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ 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 { bookmarkpatch } from "../../services/JD/bookmarkApi";
import { getCookie } from "../../services/cookie";
import { useParams } from "react-router-dom";

interface ExpProps {
type?: "card" | "section";
Expand Down Expand Up @@ -42,7 +45,8 @@ const Experience: React.FC<ExpProps> = ({
}) => {
const [detailId, setDetailId] = useRecoilState(detailStore);
const [localbookmark, setLocalbookmark] = useState(bookmark);

const user = getCookie("user");
const jdId = useParams().jdId;
// 카드 타입, 섹션 타입 구분
const isSection = type === "section";

Expand All @@ -56,10 +60,26 @@ const Experience: React.FC<ExpProps> = ({
}
};

const handleBookmarkPost = async (
token: string,
jobId: string,
expId: string
) => {
try {
const response = await bookmarkpatch(token, jobId, expId);
console.log(response);
} catch (error) {
console.error(error);
alert(JSON.stringify(error));
}
};

const handleBookmarkClick = (event: React.MouseEvent<HTMLDivElement>) => {
event.stopPropagation();
if (id && jdId) {
handleBookmarkPost(user.token, jdId, id.toString());
}
setLocalbookmark(!localbookmark);
//북마크 요청 api
};
return (
<StyledContainer
Expand Down
Loading

0 comments on commit ab143ce

Please sign in to comment.