diff --git a/backend/src/main/java/com/edufocus/edufocus/qna/repository/QnaRepository.java b/backend/src/main/java/com/edufocus/edufocus/qna/repository/QnaRepository.java index 19ebbcd..52ec462 100644 --- a/backend/src/main/java/com/edufocus/edufocus/qna/repository/QnaRepository.java +++ b/backend/src/main/java/com/edufocus/edufocus/qna/repository/QnaRepository.java @@ -13,8 +13,8 @@ import java.util.List; @Repository public interface QnaRepository extends JpaRepository { - List findByLectureId(Long lecturerId); - + //List findByLectureId(Long lecturerId); + @Query("SELECT q FROM Qna q WHERE q.lecture.id = :lectureId ORDER BY q.createdAt DESC") Page findByLectureId(Long lectureId, Pageable pageable); }