Skip to content

Commit

Permalink
feat: #159 질문 조회 정렬순서 livedAt 기준으로 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
jaewonLeeKOR committed Sep 16, 2024
1 parent 8bf270b commit 1fc5ccb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ private BaseResponse<QuestionSummary> getMainQuestion(@AuthMember Member member)
})
@GetMapping
private BaseResponse<SliceResponse<QuestionInfo>> getQuestions(@AuthMember Member member, @RequestParam(defaultValue = "0", required = false) Integer pageNumber, @RequestParam(defaultValue = "1000", required = false) Integer pageSize) {
return BaseResponse.onSuccess(questionService.getQuestions(member, PageRequest.of(pageNumber, pageSize, Sort.by(Sort.Direction.DESC, "createdAt"))));
return BaseResponse.onSuccess(questionService.getQuestions(member, PageRequest.of(pageNumber, pageSize, Sort.by(Sort.Direction.DESC, "livedAt"))));
}

@Operation(summary = "질문 좋아요/취소 API", description = " 질문 좋아요/취소 API 입니다." +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public void closeLiveQuestionTest() {
@Transactional
public void getQuestionsTest() {
//given & when
List<QuestionInfo> questionInfos = questionService.getQuestions(member, PageRequest.of(0, 1000, Sort.by(Sort.Direction.DESC, "createdAt"))).getContent();
List<QuestionInfo> questionInfos = questionService.getQuestions(member, PageRequest.of(0, 1000, Sort.by(Sort.Direction.DESC, "livedAt"))).getContent();

//then
assertEquals(questionInfos.size(), 2);
Expand Down

0 comments on commit 1fc5ccb

Please sign in to comment.