- Timestamp:
- 10/07/21 20:07:41 (3 years ago)
- Branches:
- master
- Children:
- 0c37625
- Parents:
- 0f4f552
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/main/java/it/finki/charitable/services/DonationPostService.java
r0f4f552 r276a8b6 54 54 } 55 55 56 public Page<DonationPost> findPaginated(int pageNo, int pageSize, String sort) { 57 Pageable pageable = PageRequest.of(pageNo - 1, pageSize, Sort.by(sort)); 58 return donationPostRepository.findAll(pageable); 56 public Page<DonationPost> findPaginated(int pageNo, int pageSize, String sort, String order) { 57 Sort s = Sort.by(sort); 58 s = order.equals("asc") ? s.ascending() : s.descending(); 59 Pageable pageable = PageRequest.of(pageNo - 1, pageSize, s); 60 return donationPostRepository.findAllByApproved(pageable, true); 59 61 } 60 62 }
Note:
See TracChangeset
for help on using the changeset viewer.