Skip to content

Commit

Permalink
fix : 리뷰 등록 controller 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
KkomSang committed Aug 22, 2024
1 parent e3fd2b3 commit 98ea121
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public ApiResponse<ReviewResponseDTO.ReviewResultDTO> createReview(
HttpServletRequest httpServletRequest,
@Valid @RequestPart(value = "request") ReviewRequestDTO.ReviewDTO request,
@PathVariable(name="placeId") Long placeId,
@ModelAttribute(value = "reviewImgUrls") List<MultipartFile> reviewImgUrls) {
@RequestPart(value = "img", required = false) List<MultipartFile> img) {
if(request.getRating() == null) {
throw new ReviewsHandler(ErrorStatus.RATING_NOT_EXIST);
}
Expand All @@ -49,7 +49,7 @@ public ApiResponse<ReviewResponseDTO.ReviewResultDTO> createReview(
User user = userCommandService.getUser(httpServletRequest);
Long userId = user.getId();
userCommandService.calculateTravelerGradeScore(userId ,request); //여행객 점수를 증가시키는 로직
ReviewResponseDTO.ReviewResultDTO response = reviewService.createReview(user, placeId, request, reviewImgUrls);
ReviewResponseDTO.ReviewResultDTO response = reviewService.createReview(user, placeId, request, img);
return ApiResponse.of(SuccessStatus.REVIEW_CREATE_OK,response);
}

Expand Down

0 comments on commit 98ea121

Please sign in to comment.