Skip to content

Commit

Permalink
#343 [fix] 대표 규칙 룰 개수 체크 시 상수 사용하도록 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
hyejungg committed Jul 31, 2023
1 parent e5fc719 commit 9bb9a2d
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import hous.api.service.rule.dto.request.UpdateRuleRequestDto;
import hous.api.service.rule.dto.response.RuleInfo;
import hous.api.service.user.UserServiceUtils;
import hous.common.constant.Constraint;
import hous.common.exception.ConflictException;
import hous.common.exception.ForbiddenException;
import hous.common.type.FileType;
Expand Down Expand Up @@ -225,7 +226,7 @@ public void updateRepresentRule(UpdateRuleRepresentRequestDto request, Long user
Room room = RoomServiceUtils.findParticipatingRoom(user);

Set<Long> ruleIds = new HashSet<>(request.getRules());
if (ruleIds.size() > 3) {
if (ruleIds.size() > Constraint.RULE_REPRESENT_MAX) {
throw new ForbiddenException(String.format("방 (%s) 의 대표 rule 는 3 개를 초과할 수 없습니다.", room.getId()),
FORBIDDEN_REPRESENT_RULE_COUNT_EXCEPTION);
}
Expand Down

0 comments on commit 9bb9a2d

Please sign in to comment.