File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
src/main/java/guesthouse/user/service Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change 44import guesthouse .certificate .repository .CertificateRepository ;
55import guesthouse .user .domain .model .User ;
66import guesthouse .user .domain .vo .Gender ;
7+ import guesthouse .user .domain .vo .PersonalInfo ;
78import guesthouse .user .dto .ProfileDTO ;
89import guesthouse .user .exception .UserErrorCode ;
910import guesthouse .user .exception .UserException ;
@@ -28,6 +29,7 @@ public User findById(Long id) {
2829 .orElseThrow (() -> new UserException (UserErrorCode .NOT_FOUND ));
2930 }
3031
32+ @ Transactional
3133 public void updatePersonalInfo (String name ,
3234 String phoneNumber ,
3335 LocalDate birthDate ,
@@ -47,8 +49,9 @@ public ProfileDTO getProfile(Long userId) {
4749 boolean hasInReview = certificates .stream ()
4850 .anyMatch (certificate -> certificate .getStatus ().isInReview ());
4951
52+ PersonalInfo personalInfo = user .getPersonalInfo ();
5053 return new ProfileDTO (
51- user . getPersonalInfo (). getName (),
54+ personalInfo != null ? personalInfo . getName () : null ,
5255 user .getProfileImageUrl (),
5356 isOwner ,
5457 hasInReview
You can’t perform that action at this time.
0 commit comments