From f0e7506a27978826f8c47eb20900a00611f6ef22 Mon Sep 17 00:00:00 2001 From: yyypearl Date: Thu, 23 May 2024 19:53:41 +0900 Subject: [PATCH] =?UTF-8?q?fix(#86):=20=EA=B5=90=EC=9C=A1=EC=B2=AD=20?= =?UTF-8?q?=EC=83=81=EC=84=B8=20=EB=B3=B4=EA=B8=B0=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/news/eduOffice/page.tsx | 3 ++- src/app/news/school/page.tsx | 2 +- src/components/news/Summary.tsx | 9 ++++++++- src/components/news/SummaryCard.tsx | 8 ++++---- 4 files changed, 15 insertions(+), 7 deletions(-) diff --git a/src/app/news/eduOffice/page.tsx b/src/app/news/eduOffice/page.tsx index 85fdf7e..2c95fc4 100644 --- a/src/app/news/eduOffice/page.tsx +++ b/src/app/news/eduOffice/page.tsx @@ -31,6 +31,7 @@ const EduOffice = () => { .then((response) => { const summaryData = response.data.educationOfficeAnnouncementInfos; setSummaryData(summaryData); + console.log(summaryData); }) .catch((error) => {}); }, []); @@ -72,7 +73,7 @@ const EduOffice = () => { /> - {summaryData && } + {summaryData && } diff --git a/src/app/news/school/page.tsx b/src/app/news/school/page.tsx index 4208f60..49f7ef2 100644 --- a/src/app/news/school/page.tsx +++ b/src/app/news/school/page.tsx @@ -73,7 +73,7 @@ const School = () => { /> - {summaryData && } + {summaryData && } diff --git a/src/components/news/Summary.tsx b/src/components/news/Summary.tsx index cb4f64c..f1c678e 100644 --- a/src/components/news/Summary.tsx +++ b/src/components/news/Summary.tsx @@ -21,13 +21,20 @@ interface AnnouncementsProps { announcementId?: number; } -const Summary = ({ dummyData }: { dummyData: AnnouncementsProps[] }) => { +const Summary = ({ + type, + dummyData, +}: { + type: string; + dummyData: AnnouncementsProps[]; +}) => { return ( 가정통신문, 세 문장 요약해드려요 {dummyData.map((data, index) => ( { const { - type = "school", + type, summaryType = "simple", isNew, category, @@ -54,7 +54,7 @@ const SummaryCard = (props: AnnouncementsProps) => { const router = useRouter(); - const handleCardClick = (announcementId: number) => { + const handleCardClick = (type: string, announcementId: number) => { router.push(`/news/${type}/${announcementId}`); }; @@ -62,8 +62,8 @@ const SummaryCard = (props: AnnouncementsProps) => { handleCardClick(announcementId) + summaryType === "simple" && type && announcementId + ? () => handleCardClick(type, announcementId) : undefined } >