Skip to content

Commit

Permalink
factorisation et nettoyage
Browse files Browse the repository at this point in the history
  • Loading branch information
Remi81 committed Jan 23, 2025
1 parent 6c47413 commit 3709721
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 968 deletions.
1 change: 0 additions & 1 deletion src/Controller/Aid/AidController.php
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,6 @@ public function exportList(

$aidParams = [
'showInSearch' => true,
'selectComplete' => true,
];

$aidParams = array_merge($aidParams, $aidSearchFormService->convertAidSearchClassToAidParams($aidSearchClass));
Expand Down
6 changes: 2 additions & 4 deletions src/Controller/Api/Aid/AidController.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ public function index(
// parametres pour requetes aides
$aidParams = [
'showInSearch' => true,
'selectComplete' => true
];

// on fusionne les paramètres de recherche avec les paramètres de requête
Expand Down Expand Up @@ -135,16 +134,15 @@ public function all(
): JsonResponse {
$params = [
'showInSearch' => true,
'selectComplete' => true,
'orderBy' => ['sort' => 'a.id', 'order' => 'DESC']
];
// requete pour compter sans la pagination
$results = $aidService->searchForApi($params);
$results = $aidService->searchAidsV3($params);
$count = count($results);

// requete pour les résultats avec la pagination
$results = array_slice($results, ($this->getPage() - 1) * $this->getItemsPerPage(), $this->getItemsPerPage());
$results = $aidService->getAidsFromResults($results);
$results = $aidService->hydrateLightAids($results, $params);
// spécifique
$resultsSpe = $this->getResultsSpe($results, $aidService);

Expand Down
Loading

0 comments on commit 3709721

Please sign in to comment.