Skip to content

Commit

Permalink
Merge pull request #109 from Hanaro-trip-together-bank/feature/trip-p…
Browse files Browse the repository at this point in the history
…lace

fix: 일정 추가/수정 -> 장소 null 가능하게 수정
  • Loading branch information
mummhy0811 authored Jun 4, 2024
2 parents 81a6293 + 9a0bf4e commit e2d60c8
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,10 @@ public void updatePlace(Long trip_placeIdx, TripPlaceUpdateInfoReqDto dto) {
TripPlace tripPlace = checkTripPlaceExists(trip_placeIdx);
validateTeamMember(tripPlace.getTrip().getTeam(), dto.getMemberIdx());

PlaceEntity place = placeService.findByPlaceIdx(dto.getPlaceIdx());
PlaceEntity place = null;
if(dto.getPlaceIdx()!=0){
place = placeService.findByPlaceIdx(dto.getPlaceIdx());
}
Member member = memberService.findByMemberIdx(dto.getMemberIdx());
tripPlace.update(place, dto.getPlaceAmount(), dto.getPlaceMemo(), member);
}
Expand Down Expand Up @@ -139,7 +142,10 @@ public void updateTripPlace(Long tripIdx, TripPlaceUpdateReqDto reqDto) {
List<TripPlaceUpdateAddReqDto> dtos = reqDto.getNewPlaces();
for(TripPlaceUpdateAddReqDto dto : dtos) {
validateTripDate(trip, dto.getTripDate());
PlaceEntity place = placeService.findByPlaceIdx(dto.getPlaceIdx());
PlaceEntity place = null;
if(dto.getPlaceIdx()!=0){
place = placeService.findByPlaceIdx(dto.getPlaceIdx());
}
TripPlace tripPlace = TripPlace.builder()
.trip(trip)
.tripDate(dto.getTripDate())
Expand Down

0 comments on commit e2d60c8

Please sign in to comment.