Skip to content

Commit

Permalink
Merge pull request #242 from Review-zip/fix/#241-fix-sms-error
Browse files Browse the repository at this point in the history
[Fix] SMS 쿼리 반환 결과 에러 수정
  • Loading branch information
hsuush authored Feb 20, 2024
2 parents d9779c7 + 44dcb7e commit b2d2c29
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ public interface UsersRepository extends JpaRepository<Users, Long> {
boolean existsBySocial(String social);
Optional<Users> findBySocial(String social);

Optional<Users> findByPhoneNum(String phoneNum);
List<Users> findByPhoneNum(String phoneNum);
}
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ public void resetPassword(SmsDto.PasswordResetRequestDto requestDto) {
}
String encodedPassword = passwordEncoder.encode(requestDto.getPassword());
Users user = usersRepository.findByPhoneNum(requestDto.getPhoneNum())
.stream()
.findFirst()
.orElseThrow(() -> new UsersHandler(ErrorStatus.USER_NOT_FOUND));
user.setPassword(encodedPassword);
usersRepository.save(user);
Expand Down

0 comments on commit b2d2c29

Please sign in to comment.