diff --git a/src/apis/bookmarks/type.ts b/src/apis/bookmarks/type.ts index 3841856..899891e 100644 --- a/src/apis/bookmarks/type.ts +++ b/src/apis/bookmarks/type.ts @@ -3,7 +3,8 @@ export interface BookmarkResponseType { } export interface BookmarkItemsType { - company_name: string; - recruitment_id: number; - created_at: string; -} + "company_logo_url": string; + "company_name": string; + "recruitment_id": number; + "created_at": string; +} \ No newline at end of file diff --git a/src/components/BookmarkCard.tsx b/src/components/BookmarkCard.tsx index db262a0..7c5c5ad 100644 --- a/src/components/BookmarkCard.tsx +++ b/src/components/BookmarkCard.tsx @@ -1,10 +1,20 @@ -import { useGetBookmarks } from "@/apis/bookmarks"; +import { useGetBookmarks, useSetBookmarks } from "@/apis/bookmarks"; import { Icon } from "@team-return/design-system"; import Link from "next/link"; import HoverPrefetchLink from "./common/HoverPrefetchLink"; +import Image from "next/image"; +import { useEffect, useState } from "react"; +import { BookmarkItemsType } from "@/apis/bookmarks/type"; export default function BookmarkCard() { const { data: bookmarks } = useGetBookmarks(); + const { mutate: SetBookmarksMutate } = useSetBookmarks(); + + const [localBookmarks, setLocalBookmarks] = useState(bookmarks?.bookmarks || []) + + useEffect(()=>{ + if(bookmarks) setLocalBookmarks(bookmarks.bookmarks); + },[bookmarks?.bookmarks]) return (
@@ -17,17 +27,29 @@ export default function BookmarkCard() {
)} - {bookmarks?.bookmarks.map(({ company_name, recruitment_id }) => ( + {localBookmarks.map(({ company_name, recruitment_id, company_logo_url }) => (
+
+ 기업로고 +

{company_name}

-
diff --git a/src/components/recruitments/RecruitmentsCard.tsx b/src/components/recruitments/RecruitmentsCard.tsx index ab7c5eb..3e5f391 100644 --- a/src/components/recruitments/RecruitmentsCard.tsx +++ b/src/components/recruitments/RecruitmentsCard.tsx @@ -39,7 +39,6 @@ export default function RecruitmentsCard({ maxLength = 12 }: PropsType) { function RecruitmentsItem({ company_profile_url, company_name, - train_pay, hiring_jobs, bookmarked, id,