Skip to content

Commit

Permalink
fix: 일정 추가/수정 -> 장소 null 가능하게 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
mummhy0811 committed Jun 4, 2024
1 parent 4d0f500 commit 9a0bf4e
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 9a0bf4e

Please sign in to comment.