diff --git a/src/app/mypage/notice/detail/[id]/page.tsx b/src/app/mypage/notice/detail/[id]/page.tsx index 19930d3..e3aa972 100644 --- a/src/app/mypage/notice/detail/[id]/page.tsx +++ b/src/app/mypage/notice/detail/[id]/page.tsx @@ -1,13 +1,11 @@ 'use client' -import { useGetNoticeDetailData, useGetNoticeListData } from "@/apis/notice"; -import { useEffect, useState } from "react"; +import { useGetNoticeDetailData } from "@/apis/notice"; import AttachedBox from "@/components/notice/AttachedBox"; export default function NoticeDetailPage(props:any) { const noticeId = props.params.id const {noticeDetail} = useGetNoticeDetailData(noticeId); - // const items = [noticeDetail] return (
@@ -18,7 +16,7 @@ export default function NoticeDetailPage(props:any) {

{noticeDetail?.title}

{noticeDetail?.created_at.substring(0, 10)}

{noticeDetail?.content}

- +
diff --git a/src/components/notice/AttachedBox.tsx b/src/components/notice/AttachedBox.tsx index 6741c59..034fc01 100644 --- a/src/components/notice/AttachedBox.tsx +++ b/src/components/notice/AttachedBox.tsx @@ -6,10 +6,10 @@ import { file_name_regex } from "@/util/regex"; import axios from "axios"; interface PropsType { - props: AttachmentResponse[] + attachmentProps: AttachmentResponse[] } -export default function AttachedBox ({props}: PropsType) { +export default function AttachedBox ({attachmentProps}: PropsType) { const downLoadFile = async (attachment: AttachmentResponse) => { try { const response = await axios.get(`${process.env.NEXT_PUBLIC_IMAGE_URL}/${attachment.url}`, { @@ -34,7 +34,7 @@ export default function AttachedBox ({props}: PropsType) {
첨부자료
- {props.map((attachment) => ( + {attachmentProps && attachmentProps.map((attachment) => (
{file_name_regex(attachment.url)}
downLoadFile(attachment)} /> diff --git a/src/components/notice/NoticeListTable.tsx b/src/components/notice/NoticeListTable.tsx index e01de46..c0cedf2 100644 --- a/src/components/notice/NoticeListTable.tsx +++ b/src/components/notice/NoticeListTable.tsx @@ -8,13 +8,13 @@ export default function NoticeListTable () { return ( <> - {notices.map((notice, index) => ( - + {notices.map(({id, title, created_at}, index) => ( + {index+1} - {notice.title} - {notice.created_at.substring(0, 10)} + {title} + {created_at.substring(0, 10)}