Skip to content

Commit

Permalink
fix : 리뷰 수정 메서드 Put으로 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
KkomSang committed Aug 23, 2024
1 parent 54ecf84 commit fb23ccb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/main/java/com/example/locavel/service/ReviewService.java
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ public ReviewResponseDTO.ReviewUpdateResultDTO updateReview(Long reviewId, Revie
Reviews review = reviewRepository.findById(reviewId)
.orElseThrow(()->new ReviewsHandler(ErrorStatus.REVIEW_NOT_FOUND));
Places place = review.getPlace();
if(request.getRating() != null) {review.setRating(request.getRating());}
if(request.getComment() != null) {review.setComment(request.getComment());}
review.setRating(request.getRating());
review.setComment(request.getComment());
if(reviewImgUrls != null) {uploadReviewImg(reviewImgUrls, review, true);}
Reviews updatedReview = reviewRepository.save(review);
placeService.setReview(place);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public ApiResponse<ReviewResponseDTO.ReviewResultDTO> createReview(
}

@Operation(summary = "리뷰 수정", description = "리뷰를 수정합니다.")
@PatchMapping(value = "/{reviewId}", consumes = "multipart/form-data")
@PutMapping(value = "/{reviewId}", consumes = "multipart/form-data")
public ApiResponse<ReviewResponseDTO.ReviewUpdateResultDTO> updateReview(
@Valid @RequestPart ReviewRequestDTO.ReviewDTO request,
@PathVariable(name="reviewId") Long reviewId,
Expand Down

0 comments on commit fb23ccb

Please sign in to comment.