Skip to content

Commit

Permalink
[#128] fix: 쿼리 오류 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
dl-00-e8 committed May 18, 2024
1 parent ae906ca commit c5b22ae
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ public GetPostRelation checkPostRelation(Member member, Long postId) {

@Transactional
public Page<GetProjectRes> getMyScrapProject(Member member, Pageable page){
Pageable pageable = PageRequest.of(page.getPageNumber(), page.getPageSize(), Sort.by(Sort.Direction.DESC, "created_at"));
Pageable pageable = PageRequest.of(page.getPageNumber(), page.getPageSize(), Sort.by("createdAt").descending());

Page<PostScrap> scrapPageList = postScrapRepository.findAllByMemberAndScrapStatusTrueOrderByPostScrapIdDesc(member, pageable);

Expand All @@ -398,7 +398,7 @@ public Page<GetProjectRes> getMyScrapProject(Member member, Pageable page){

@Transactional
public Page<GetContestRes> getMyScrapContest(Member member, Pageable page){
Pageable pageable = PageRequest.of(page.getPageNumber(), page.getPageSize(), Sort.by(Sort.Direction.DESC, "created_at"));
Pageable pageable = PageRequest.of(page.getPageNumber(), page.getPageSize(), Sort.by("createdAt").descending());

Page<PostScrap> scrapPageList = postScrapRepository.findAllByMemberAndScrapStatusTrueOrderByPostScrapIdDesc(member, pageable);

Expand All @@ -422,4 +422,9 @@ public Page<GetContestRes> getMyScrapContest(Member member, Pageable page){
// 필터링된 리스트를 페이지로 반환
return new PageImpl<>(filteredContests, pageable, scrapPageList.getTotalElements());
}

// @Transactional
// public ? completePost() {
//
// }
}

0 comments on commit c5b22ae

Please sign in to comment.