Skip to content

Commit

Permalink
#9 fix : 모임 개설시, city 생성 오류
Browse files Browse the repository at this point in the history
  • Loading branch information
shinhn committed Mar 24, 2023
1 parent 0e4b823 commit a1f191b
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 a1f191b

Please sign in to comment.