Skip to content

Commit

Permalink
[�merge] all로 요청이 들어올 경우 모든 모임 반환 추가
Browse files Browse the repository at this point in the history
[feat] all로 요청이 들어올 경우 모든 모임 반환 추가
  • Loading branch information
bo-ram-bo-ram authored Sep 27, 2024
2 parents 927c1ea + b12fae6 commit 9a59152
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,14 @@ public MoimByGuestResponse getSubmittedMoimDetail(final Long moimId) {
}

public List<MoimByCategoryResponse> getMoimListByCategory(final String category) {
List<Moim> moimList = moimRepository.findMoimListByCategory(category);
List<Moim> moimList;

if (category.equals("all")) {
moimList = moimRepository.findAll();
} else {
moimList = moimRepository.findMoimListByCategory(category);
}

return moimList.stream()
.map(oneMoim -> MoimByCategoryResponse.builder()
.moimId(oneMoim.getId())
Expand Down

0 comments on commit 9a59152

Please sign in to comment.