Skip to content

Commit

Permalink
Merge pull request #38 from Sketcher-s/fix/37-mypage
Browse files Browse the repository at this point in the history
🐛 FIX: 마이페이지 검시 리스트 최신순 정렬
  • Loading branch information
gyehwan24 authored Jun 2, 2024
2 parents 76ce651 + 2a03396 commit c4caba1
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import shop.catchmind.member.domain.Member;
Expand Down Expand Up @@ -42,7 +43,8 @@ public GetPictureListResponse getMyPage(final Long memberId, final int page, fin
SimpleMemberDto simpleMemberDto = SimpleMemberDto.of(memberDto);

// 그림 목록 조회 (페이지네이션 적용)
Pageable pageable = PageRequest.of(page, size);
Pageable pageable = PageRequest.of(page, size, Sort.by(Sort.Direction.DESC, "createdAt"));

Page<Picture> picturePage = pictureRepository.findAllByMemberId(memberId, pageable);
List<SimplePictureDto> simplePictureDtoList = picturePage.stream()
.map(PictureDto::of)
Expand Down

0 comments on commit c4caba1

Please sign in to comment.