diff --git a/src/components/notice/NoticePostCard.tsx b/src/components/notice/NoticePostCard.tsx
index d8951ceb..4f60bd51 100644
--- a/src/components/notice/NoticePostCard.tsx
+++ b/src/components/notice/NoticePostCard.tsx
@@ -1,6 +1,6 @@
import { useCallback } from 'react';
-import { Link } from 'react-router-dom';
+import { useNavigate } from 'react-router-dom';
import { useNoticeIncrementViewCount } from '@/services/post/noticeMutations';
@@ -33,15 +33,20 @@ export default function NoticePostCard({ notice }: NoticePostCardProps) {
const { mutateAsync: postViewCount } = useNoticeIncrementViewCount();
+ const navigate = useNavigate();
+
const onViewCount = useCallback(async () => {
await postViewCount({ noticeId: notice.noticeId });
- }, [notice.noticeId, postViewCount]);
+ navigate(`/notice/post/${notice.postId}`);
+ }, [navigate, notice.noticeId, notice.postId, postViewCount]);
return (
-
e.key === 'Enter' && onViewCount()}
>
-
+
);
}
diff --git a/src/components/notice/layout/NoticeDisplayList.tsx b/src/components/notice/layout/NoticeDisplayList.tsx
index d2598c0d..45c5cb39 100644
--- a/src/components/notice/layout/NoticeDisplayList.tsx
+++ b/src/components/notice/layout/NoticeDisplayList.tsx
@@ -1,6 +1,5 @@
import {
useGetCloseSoonNoticeList,
- useGetInfiniteNoticeList,
useGetThisWeekNoticeList,
} from '@/services/post/noticeQueries';
@@ -8,7 +7,7 @@ import { HasAdminRole, NoticeDisplay } from '@/types';
import TitleLinkWithRoleTag from '@/components/common/TitleLinkWithRoleTag';
-type NoticeTitle = '공지사항' | 'NEW' | '마감임박';
+type NoticeTitle = 'NEW' | '마감임박';
interface NoticeInfoListProps {
title: NoticeTitle;
@@ -19,40 +18,29 @@ export default function NoticeDisplayList({
title,
className = '',
}: NoticeInfoListProps) {
- const {
- data: thisWeekNoticeList = [],
- isLoading: isInfiniteNoticListLoading,
- } = useGetThisWeekNoticeList();
-
- const {
- data = {
- pages: [{ notices: [] }],
- },
- isLoading: isInfiniteNoticeListLoading,
- } = useGetInfiniteNoticeList({ page: 1, size: 4 });
-
const {
data: closeSoonNoticeList = [],
isLoading: isCloseSoonNoticeList, //
} = useGetCloseSoonNoticeList({ size: 4, days: 7 });
- const isLoading =
- isCloseSoonNoticeList ||
- isInfiniteNoticeListLoading ||
- isInfiniteNoticListLoading;
+ const {
+ data: thisWeekNoticeList = [],
+ isLoading: isInfiniteNoticListLoading,
+ } = useGetThisWeekNoticeList();
const noticeObj: {
[key in NoticeTitle]: (NoticeDisplay & {
manager?: { role: keyof HasAdminRole };
})[];
} = {
- 공지사항: data.pages[0].notices,
마감임박: closeSoonNoticeList,
NEW: thisWeekNoticeList,
};
const noticeDisplayList = noticeObj[title];
+ const isLoading = isCloseSoonNoticeList || isInfiniteNoticListLoading;
+
return (
!isLoading &&
(noticeDisplayList?.length !== 0 ? (
diff --git a/src/components/post-collection/PostTableRow.tsx b/src/components/post-collection/PostTableRow.tsx
index b6f2ce26..8ddcf7b5 100644
--- a/src/components/post-collection/PostTableRow.tsx
+++ b/src/components/post-collection/PostTableRow.tsx
@@ -10,29 +10,29 @@ import TrashButton from '@/components/common/button/TrashButton';
import Checkbox from '@/components/common/checkbox/Checkbox';
import TableDataCell from '@/components/common/table/TableDataCell';
-interface PostTableRowProps {
+interface PostTableRowProps