Skip to content

Commit

Permalink
Merge pull request #182 from YogitTeam/feat/user-profile
Browse files Browse the repository at this point in the history
#9 fix : 모임 개설시, city 생성 오류
  • Loading branch information
shinhn authored Mar 24, 2023
2 parents a66a06e + a1f191b commit 28efab4
Showing 1 changed file with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -105,15 +105,13 @@ public ApplicationResponse<UserProfileRes> enterProfile(CreateUserProfileReq cre
user.addAdditionalProfile(createUserProfileReq.getLatitude(), createUserProfileReq.getLongitude(), createUserProfileReq.getAboutMe(), createUserProfileReq.getJob());

// 기존에 존재하는 city인 경우
City city = new City();
if(cityRepository.existsByCityName(createUserProfileReq.getCityName())){
City city = cityRepository.findByCityName(createUserProfileReq.getCityName());
city = cityRepository.findByCityName(createUserProfileReq.getCityName());
city.addUser(user);
}
else{ // 기존에 존재하지 않는 city인 경우
City city = City.builder()
.user(user)
.cityName(createUserProfileReq.getCityName())
.build();
city.changeCityName(createUserProfileReq.getCityName());
cityRepository.save(city);
city.addUser(user);
}
Expand Down

0 comments on commit 28efab4

Please sign in to comment.