Skip to content

Commit

Permalink
Fix sur page a retourner
Browse files Browse the repository at this point in the history
  • Loading branch information
pierre-maraval committed May 6, 2024
1 parent 891bf79 commit 710f0b0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,6 @@ public List<Demande> findAll() {
public List<Demande> getAllActiveDemandesForAdmin(String iln, int page, int size) {
List<DemandeExemp> demandeExemps = demandeExempDao.getAllActiveDemandesExempForAdmin(iln, PageRequest.of(page, size));
List<Demande> demandeList = new ArrayList<>(demandeExemps);
//TODO 1 chopper les rcr en une iste string, 2 dao xml pour recuperer la liste des libelle avec un tableau mappé, 3 alimenter les entites LIB iteration

setIlnShortNameOnList(demandeList);
return demandeList;
}
Expand Down
6 changes: 3 additions & 3 deletions web/src/main/java/fr/abes/item/web/DemandeRestService.java
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public DemandeRestService(DemandeExempService demandeExempService, CheckAccessTo
public List<DemandeWebDto> getAllActiveDemandes(@RequestParam("type") TYPE_DEMANDE type, @RequestParam("extension") boolean extension, @RequestParam("page")int page, @RequestParam("size") int size, HttpServletRequest request) {
String iln = request.getAttribute("iln").toString();
IDemandeService service = strategy.getStrategy(IDemandeService.class, type);
return (!extension) ? service.getAllActiveDemandesForAdmin(iln, page, size).stream().map(element -> builder.buildDto(element, type)).collect(Collectors.toList()) : service.getAllActiveDemandesForAdminExtended(page, size).stream().map(element -> builder.buildDto(element, type)).collect(Collectors.toList());
return (!extension) ? service.getAllActiveDemandesForAdmin(iln, page - 1, size).stream().map(element -> builder.buildDto(element, type)).collect(Collectors.toList()) : service.getAllActiveDemandesForAdminExtended(page - 1, size).stream().map(element -> builder.buildDto(element, type)).collect(Collectors.toList());
}

/**
Expand All @@ -71,7 +71,7 @@ public List<DemandeWebDto> getAllActiveDemandes(@RequestParam("type") TYPE_DEMAN
public List<DemandeWebDto> chercher(@RequestParam("type") TYPE_DEMANDE type, @RequestParam("page")int page, @RequestParam("size")int size, HttpServletRequest request) {
String iln = request.getAttribute("iln").toString();
IDemandeService service = strategy.getStrategy(IDemandeService.class, type);
return service.getActiveDemandesForUser(iln, page, size).stream().map(element -> builder.buildDto(element, type)).collect(Collectors.toList());
return service.getActiveDemandesForUser(iln, page - 1, size).stream().map(element -> builder.buildDto(element, type)).collect(Collectors.toList());
}

/**
Expand All @@ -87,7 +87,7 @@ public List<DemandeWebDto> chercher(@RequestParam("type") TYPE_DEMANDE type, @Re
public List<DemandeWebDto> getAllArchivedDemandes(@RequestParam("type") TYPE_DEMANDE type, @RequestParam("extension") boolean extension, @RequestParam("page")int page, @RequestParam("size")int size, HttpServletRequest request) {
String iln = request.getAttribute("iln").toString();
IDemandeService service = strategy.getStrategy(IDemandeService.class, type);
return (!extension) ? service.getAllArchivedDemandes(iln, page, size).stream().map(element -> builder.buildDto(element, type)).collect(Collectors.toList()) : service.getAllArchivedDemandesAllIln(page, size).stream().map(element -> builder.buildDto(element, type)).collect(Collectors.toList());
return (!extension) ? service.getAllArchivedDemandes(iln, page - 1, size).stream().map(element -> builder.buildDto(element, type)).collect(Collectors.toList()) : service.getAllArchivedDemandesAllIln(page - 1, size).stream().map(element -> builder.buildDto(element, type)).collect(Collectors.toList());
}

/**
Expand Down

0 comments on commit 710f0b0

Please sign in to comment.