Skip to content

fix: GET /api/groups 빈 목록 시 200+[] 반환#344

Merged
yoon6yo merged 1 commit into
developfrom
fix/group-empty-list-338
Jul 12, 2026
Merged

fix: GET /api/groups 빈 목록 시 200+[] 반환#344
yoon6yo merged 1 commit into
developfrom
fix/group-empty-list-338

Conversation

@yoon6yo

@yoon6yo yoon6yo commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

Summary

Closes #338

getAllGroups()에서 그룹이 없으면 NO_AVAILABLE_GROUPS (404)를 던졌음.
빈 컬렉션은 에러가 아니므로 빈 리스트([])를 200으로 반환하도록 수정.

그룹이 없는 초기 환경에서 프론트엔드 신청 폼이 즉시 오류 화면을 보이는 문제가 해결됨.

Test plan

  • 그룹이 없을 때 GET /api/groups200 OK, body []
  • 그룹이 있을 때 GET /api/groups200 OK, body [{...}, ...]

그룹이 없는 초기 환경에서 신청 폼 등이 즉시 오류 화면을 보이는 문제 수정.
Empty는 에러가 아니므로 빈 리스트를 정상 응답으로 반환.
@coderabbitai

coderabbitai Bot commented Jul 11, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 87b4ea4a-8f11-4f75-9471-71f23dd35f40

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/group-empty-list-338

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

GET /api/groups 호출 시 그룹이 0개인 초기 환경에서 404(NO_AVAILABLE_GROUPS)가 발생하던 동작을, REST 관행에 맞게 200 OK + 빈 리스트 반환으로 변경해 프론트엔드에서 즉시 오류 화면으로 전환되는 문제를 해소하려는 PR입니다.

Changes:

  • GroupService#getAllGroups()에서 “빈 목록이면 404 예외” 로직을 제거하여 빈 리스트를 그대로 반환하도록 변경
  • 관련 로그 흐름을 “0개 그룹” 케이스까지 자연스럽게 처리되도록 정리(예외 제거에 따른 기본 흐름 유지)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 44 to 48
log.info("[getAllGroups] 모든 그룹 정보 조회 시작");
var groups = groupRepository.findAll();

if (groups.isEmpty()) {
log.warn("[getAllGroups] 조회된 그룹 정보가 없습니다.");
throw new BusinessException(ErrorCode.NO_AVAILABLE_GROUPS);
}

var response = groups.stream()
.map(GroupResponseDTO::fromEntity)
Comment on lines 44 to 48
log.info("[getAllGroups] 모든 그룹 정보 조회 시작");
var groups = groupRepository.findAll();

if (groups.isEmpty()) {
log.warn("[getAllGroups] 조회된 그룹 정보가 없습니다.");
throw new BusinessException(ErrorCode.NO_AVAILABLE_GROUPS);
}

var response = groups.stream()
.map(GroupResponseDTO::fromEntity)
@yoon6yo
yoon6yo merged commit 45907b3 into develop Jul 12, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix: GroupService.getAllGroups() 빈 목록 시 404 반환 → 200+[] 로 변경

2 participants