Merge branch 'Be/Board' into 'backend'

[Back-End] refactor : 게시판 정렬 변경

See merge request s11-webmobile1-sub2/S11P12A701!104
This commit is contained in:
김기창 2024-08-08 10:55:11 +09:00
commit 499afc2a76

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();