Skip to content

Commit

Permalink
Merge pull request #212 from urinaner/feature/184
Browse files Browse the repository at this point in the history
[FE] [FEAT] 게시판 리스트 등록일 정렬 기능 추가
  • Loading branch information
ye6194 authored Dec 21, 2024
2 parents 9291ad0 + d063192 commit f38d885
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
8 changes: 7 additions & 1 deletion frontend/src/pages/News/NoticeBoard/NoticeBoard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,13 @@ const NoticeBoard: React.FC = () => {
제목
</S.SortableTh>
<S.Th>작성자</S.Th>
<S.Th>등록일</S.Th>
<S.SortableTh
onClick={() => handleSort('createdDate')}
isActive={filters.sort.field === 'createdDate'}
sortDirection={filters.sort.direction}
>
등록일
</S.SortableTh>{' '}
<S.Th>카테고리</S.Th>
<S.SortableTh
onClick={() => handleSort('viewCount')}
Expand Down
3 changes: 2 additions & 1 deletion frontend/src/pages/News/NoticeBoard/hooks/useNoticeBoard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export const useNoticeBoard = () => {
filters: {
category: 'all',
sort: {
field: 'createDate',
field: 'createdDate',
direction: 'desc',
},
page: 0,
Expand Down Expand Up @@ -55,6 +55,7 @@ export const useNoticeBoard = () => {
'content',
'writer',
'viewCount',
'createdDate',
];

if (allowedSortFields.includes(state.filters.sort.field)) {
Expand Down
3 changes: 2 additions & 1 deletion frontend/src/pages/News/NoticeBoard/types/notice.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,5 @@ export type SortField =
| 'content'
| 'writer'
| 'viewCount'
| 'createDate';
| 'createDate'
| 'createdDate';

0 comments on commit f38d885

Please sign in to comment.