refactor : 게시판 정렬 변경

This commit is contained in:
yulmam 2024-08-08 10:54:17 +09:00
parent 918906de60
commit 026e4c3766

View File

@ -40,7 +40,7 @@ public class BoardServiceImpl implements BoardService {
@Transactional @Transactional
public List<ResponseBoardSummaryDto> findBoards(int pageNo, String category, long lectureId) { public List<ResponseBoardSummaryDto> findBoards(int pageNo, String category, long lectureId) {
Pageable pageable = PageRequest.of(pageNo, PAGE_SIZE, Sort.by("created_at").descending()); Pageable pageable = PageRequest.of(pageNo, PAGE_SIZE, Sort.by("id").descending());
List<Board> boards = boardRepository.findByLectureIdAndCategory(lectureId, category, pageable).getContent(); List<Board> boards = boardRepository.findByLectureIdAndCategory(lectureId, category, pageable).getContent();