Skip to content

Commit

Permalink
Merge pull request #125 from team-winey/refactor/#118
Browse files Browse the repository at this point in the history
Refactor/#118
  • Loading branch information
sss4920 authored Aug 17, 2023
2 parents db95734 + b504536 commit 7a99526
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public ApiResponse<GetAllNotiResponseDto> getAllNoti(@UserId Long userId) {
return ApiResponse.success(Success.GET_NOTIFICATIONS_SUCCESS, res);
}

@PostMapping("")
@PatchMapping("")
@ResponseStatus(HttpStatus.OK)
@Operation(summary = "์œ„๋‹ˆ ์•ˆ์ฝ์€ ์•Œ๋ฆผ ์ฝ์Œ์ฒ˜๋ฆฌ API", description = "์œ„๋‹ˆ ์•Œ๋ฆผ ์ „์ฒด๋ฅผ ์ฝ์Œ์ฒ˜๋ฆฌ ํ•ฉ๋‹ˆ๋‹ค.")
public ApiResponse checkAllNoti(@UserId Long userId){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public interface CommentRepository extends Repository<Comment,Long> {

Optional<Comment> findByCommentId(Long feedId);

List<Comment> findAllByFeedOrderByCreatedAtDesc(Feed feed);
List<Comment> findAllByFeedOrderByCreatedAtAsc(Feed feed);

// DELETE
Long deleteByCommentId(Long commentId);
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/winey/server/service/FeedService.java
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ public GetFeedDetailResponseDto getFeedDetail(Long feedId, Long userId) {
.orElseThrow(() -> new NotFoundException(Error.NOT_FOUND_FEED_EXCEPTION, Error.NOT_FOUND_FEED_EXCEPTION.getMessage()));
User connectedUser = userRepository.findByUserId(userId)
.orElseThrow(() -> new NotFoundException(Error.NOT_FOUND_USER_EXCEPTION, Error.NOT_FOUND_USER_EXCEPTION.getMessage()));
List<GetCommentResponseDto> comments = commentRepository.findAllByFeedOrderByCreatedAtDesc(detailFeed)
List<GetCommentResponseDto> comments = commentRepository.findAllByFeedOrderByCreatedAtAsc(detailFeed)
.stream().map(comment -> GetCommentResponseDto.of(
comment.getCommentId(),
comment.getUser().getUserId(),
Expand Down

0 comments on commit 7a99526

Please sign in to comment.