Ignore:
Timestamp:
10/07/21 20:29:27 (3 years ago)
Author:
KostaFortumanov <kfortumanov@…>
Branches:
master
Children:
7888b17
Parents:
0c37625
Message:

bug fix

File:
1 edited

Legend:

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

    r0c37625 ree0e297  
    4646    }
    4747
    48     public List<DonationPost> findAllByModerator(Moderator moderator) {
    49         return donationPostRepository.findAllByModerator(moderator);
     48    public Page<DonationPost> findAllByModerator(int pageNo, int pageSize, String sort, String order, Moderator moderator) {
     49        Sort s = Sort.by(sort);
     50        s = order.equals("asc") ? s.ascending() : s.descending();
     51        Pageable pageable = PageRequest.of(pageNo - 1, pageSize, s);
     52        return donationPostRepository.findAllByModerator(pageable, moderator);
    5053    }
    5154
Note: See TracChangeset for help on using the changeset viewer.