File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed
src/main/java/com/somemore/facade/validator Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -23,13 +23,15 @@ public class VolunteerDetailAccessValidatorImpl implements VolunteerDetailAccess
2323 * 해당 모집글들에 연관된 봉사자들의 ID 목록에 타겟 봉사자 ID가 포함되어 있는지 검증.
2424 */
2525 public void validateByCenterId (UUID centerId , UUID targetVolunteerId ) {
26- List <Long > allNotCompletedIdsByCenterId = recruitBoardQueryUseCase .getNotCompletedIdsByCenterIds (centerId );
26+ List <Long > notCompletedIdsByCenterIds = recruitBoardQueryUseCase .getNotCompletedIdsByCenterIds (centerId );
2727
28- List <UUID > volunteerIdsByRecruitIds = volunteerApplyQueryUseCase .getVolunteerIdsByRecruitIds (allNotCompletedIdsByCenterId );
28+ List <UUID > volunteerIdsByRecruitIds = volunteerApplyQueryUseCase .getVolunteerIdsByRecruitIds (notCompletedIdsByCenterIds );
2929
30- volunteerIdsByRecruitIds .stream ()
31- .filter (volunteerId -> volunteerId .equals (targetVolunteerId ))
32- .findAny ()
33- .orElseThrow (() -> new BadRequestException (UNAUTHORIZED_VOLUNTEER_DETAIL ));
30+ if (volunteerIdsByRecruitIds .stream ()
31+ .anyMatch (volunteerId -> volunteerId .equals (targetVolunteerId ))) {
32+ return ;
33+ }
34+
35+ throw new BadRequestException (UNAUTHORIZED_VOLUNTEER_DETAIL );
3436 }
3537}
You can’t perform that action at this time.
0 commit comments