Skip to content

Commit

Permalink
[REFACTOR] 테마 유효성 검증 로직 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
Chan531 committed Jun 28, 2024
1 parent 6fc20ce commit 6a115fc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public Map<Long, List<RoutineVO>> acquireAllInDailyWithThemeId(Set<Long> themeId
}

public Map<String, List<ChallengeVO>> acquireAllInChallengeWithThemeId(long memberId, long themeId) {
themeFinder.findById(themeId);
themeFinder.isExistById(themeId);
val member = memberFinder.findById(memberId);
val challengeIdByMember = getChallengeIdByMember(member);
val challengeRoutinesByTheme = routineFinder.findChallengeRoutinesByTheme(themeId);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.soptie.server.theme.adapter;

import static com.soptie.server.theme.message.ThemeErrorCode.*;
import static com.soptie.server.theme.message.ThemeErrorCode.INVALID_THEME;

import java.util.List;

Expand All @@ -23,10 +23,14 @@ public List<Theme> findAllOrderByNameAsc() {

public Theme findById(long id) {
return themeRepository.findById(id)
.orElseThrow(() -> new ThemeException(INVALID_THEME));
.orElseThrow(() -> new ThemeException(INVALID_THEME));
}

public List<Theme> findAllInBasic() {
return themeRepository.findAllInBasic();
}

public boolean isExistById(long id) {
return themeRepository.existsById(id);
}
}

0 comments on commit 6a115fc

Please sign in to comment.