Skip to content

Commit e7ddc83

Browse files
committed
✨ feat: 퀴즈 목록 조회 최신순으로 정렬
1 parent 0147325 commit e7ddc83

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

backend/src/main/java/io/f1/backend/domain/quiz/api/QuizController.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
import org.springframework.data.domain.PageRequest;
1414
import org.springframework.data.domain.Pageable;
15+
import org.springframework.data.domain.Sort;
1516
import org.springframework.http.HttpStatus;
1617
import org.springframework.http.MediaType;
1718
import org.springframework.http.ResponseEntity;
@@ -71,7 +72,7 @@ public ResponseEntity<QuizListPageResponse> getQuizzes(
7172
@RequestParam(required = false) String title,
7273
@RequestParam(required = false) String creator) {
7374

74-
Pageable pageable = PageRequest.of(page - 1, size);
75+
Pageable pageable = PageRequest.of(page - 1, size, Sort.by(Sort.Direction.DESC, "createdAt"));
7576
QuizListPageResponse quizzes = quizService.getQuizzes(title, creator, pageable);
7677

7778
return ResponseEntity.ok().body(quizzes);

0 commit comments

Comments
 (0)