Skip to content

Commit

Permalink
Merge pull request #571 from woowacourse-teams/dev
Browse files Browse the repository at this point in the history
데벨업 v1.0.4 Release
  • Loading branch information
Minjoo522 authored Sep 27, 2024
2 parents b06466c + bbadaaa commit 29ff22f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,19 @@ public List<SummarizedDiscussionResponse> getDiscussionsByMemberId(Long memberId
public DiscussionResponse getById(Long id) {
Discussion discussion = getDiscussion(id);

return DiscussionResponse.from(discussion);
return createDiscussionResponse(discussion);
}

public Discussion getDiscussion(Long id) {
return discussionRepository.findById(id)
.orElseThrow(() -> new DevelupException(ExceptionType.DISCUSSION_NOT_FOUND));
}

private DiscussionResponse createDiscussionResponse(Discussion discussion) {
if (discussion.getMission() == null) {
return DiscussionResponse.createWithoutMission(discussion);
}

return DiscussionResponse.from(discussion);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public Member getMember() {
}

public String getMissionTitle() {
if (mission == null) return "";
if (mission == null) return null;
return mission.getTitle();
}

Expand Down

0 comments on commit 29ff22f

Please sign in to comment.