Skip to content

Commit

Permalink
refactor: 회원정보 수정기능 완료
Browse files Browse the repository at this point in the history
  • Loading branch information
singsangssong committed Oct 15, 2024
1 parent d5a3e9d commit 4415d5a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@ public interface UserRepository extends JpaRepository<User, Long> {

@Transactional
@Modifying
@Query("UPDATE User U SET U.name = :name, U.phoneNumber = :phoneNumber, U.profilePicture = :profilePicture WHERE U.studentId = :id")
void changeUser(String id, String name, String phoneNumber, String profilePicture);
@Query("UPDATE User U SET U.name = :name, U.phoneNumber = :phoneNumber, U.profilePicture = :profilePicture " +
"WHERE U.studentNumber = :studentNumber")
void changeUser(String studentNumber, String name, String phoneNumber, String profilePicture);

}

Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,8 @@ public Page<PostOverview> showMyBlog(String studentNumber,Pageable pageable){
.orElseThrow(UserNotFoundException::new);

Page<Post> myBlog = postRepository.findByWriter(user, pageable);
List<PostOverview> overviews = myBlog.stream().map(PostOverview::of).collect(Collectors.toList());
List<PostOverview> overviews = myBlog.stream().map(PostOverview::of)
.collect(Collectors.toList());

return new PageImpl<>(overviews, pageable, myBlog.getTotalElements());
}
Expand Down

0 comments on commit 4415d5a

Please sign in to comment.