From 5e8b0b6fd648ec313bdfe7c6fc5bab3f009571da Mon Sep 17 00:00:00 2001 From: KANGYONGSU23 Date: Fri, 5 Apr 2024 10:17:02 +0900 Subject: [PATCH] =?UTF-8?q?chore=20::=20=EB=B6=81=EB=A7=88=ED=81=AC=20?= =?UTF-8?q?=EB=A6=AC=EC=8A=A4=ED=8A=B8=20=EA=B0=9C=EC=84=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 기업 로고 / 북마크 취소 --- src/apis/bookmarks/type.ts | 9 +++--- src/components/BookmarkCard.tsx | 28 +++++++++++++++++-- .../recruitments/RecruitmentsCard.tsx | 1 - 3 files changed, 30 insertions(+), 8 deletions(-) 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,