Ignore:
Timestamp:
10/07/21 20:22:23 (3 years ago)
Author:
NikolaCenevski <cenevskinikola@…>
Branches:
master
Children:
ee0e297
Parents:
276a8b6
Message:

Moderator pagination

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/main/java/it/finki/charitable/services/DonationPostService.java

    r276a8b6 r0c37625  
    5454    }
    5555
    56     public Page<DonationPost> findPaginated(int pageNo, int pageSize, String sort, String order) {
     56    public Page<DonationPost> findPaginated(int pageNo, int pageSize, String sort, String order, boolean approved) {
    5757        Sort s = Sort.by(sort);
    5858        s = order.equals("asc") ? s.ascending() : s.descending();
    5959        Pageable pageable = PageRequest.of(pageNo - 1, pageSize, s);
    60         return donationPostRepository.findAllByApproved(pageable, true);
     60        return donationPostRepository.findAllByApproved(pageable, approved);
    6161    }
    6262}
Note: See TracChangeset for help on using the changeset viewer.