Compare commits
1 commit
58c2037443
...
440160980d
Author | SHA1 | Date | |
---|---|---|---|
440160980d |
1 changed files with 10 additions and 2 deletions
|
@ -65,7 +65,14 @@ public class AdminApiController implements AdminApi {
|
||||||
if (order == null) {
|
if (order == null) {
|
||||||
order = GetAllPlayersConfigurationData.OrderEnum.DESCENDING;
|
order = GetAllPlayersConfigurationData.OrderEnum.DESCENDING;
|
||||||
}
|
}
|
||||||
Sort.Direction direction = order == GetAllPlayersConfigurationData.OrderEnum.ASCENDING ? Sort.Direction.ASC : Sort.Direction.DESC;
|
Sort.Direction direction;
|
||||||
|
|
||||||
|
if (order == GetAllPlayersConfigurationData.OrderEnum.ASCENDING) {
|
||||||
|
direction = Sort.Direction.ASC;
|
||||||
|
} else {
|
||||||
|
direction = Sort.Direction.DESC;
|
||||||
|
}
|
||||||
|
|
||||||
Pageable pageable = PageRequest.of(page, pageSize, Sort.by(direction, sortBy));
|
Pageable pageable = PageRequest.of(page, pageSize, Sort.by(direction, sortBy));
|
||||||
|
|
||||||
Page<Player> playerPage;
|
Page<Player> playerPage;
|
||||||
|
@ -76,7 +83,8 @@ public class AdminApiController implements AdminApi {
|
||||||
playerPage = playerRepository.findAll(pageable);
|
playerPage = playerRepository.findAll(pageable);
|
||||||
}
|
}
|
||||||
|
|
||||||
List<AdministratablePlayer> playersMapped = playerMapperService.mapPlayersToAdministratablePlayers(playerPage.getContent());
|
List<AdministratablePlayer> playersMapped =
|
||||||
|
playerMapperService.mapPlayersToAdministratablePlayers(playerPage.getContent());
|
||||||
|
|
||||||
if (playersMapped.isEmpty()) {
|
if (playersMapped.isEmpty()) {
|
||||||
return ResponseEntity.noContent().build();
|
return ResponseEntity.noContent().build();
|
||||||
|
|
Loading…
Add table
Reference in a new issue