Skip to content

Commit

Permalink
chore: supprime variable non utilisée
Browse files Browse the repository at this point in the history
  • Loading branch information
ocruze committed Nov 27, 2023
1 parent d38c717 commit ff4a50d
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions src/Controller/Api/DatasheetController.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

namespace App\Controller\Api;

use App\Constants\EntrepotApi\ConfigurationStatuses;
use App\Constants\EntrepotApi\CommonTags;
use App\Constants\EntrepotApi\ConfigurationStatuses;
use App\Constants\EntrepotApi\StoredDataTypes;
use App\Exception\CartesApiException;
use App\Exception\EntrepotApiException;
Expand Down Expand Up @@ -123,21 +123,21 @@ private function getBasicInfo(string $datastoreId, string $datasheetName): array
}
}

$annexeUrl = $this->getParameter("annexes_url");
$annexes = $this->entrepotApiService->annexe->getAll($datastoreId, null, null, ["datasheet_name=$datasheetName", "type=thumbnail"]);
$annexeUrl = $this->getParameter('annexes_url');
$annexes = $this->entrepotApiService->annexe->getAll($datastoreId, null, null, ["datasheet_name=$datasheetName", 'type=thumbnail']);

$thumbnail = null;
if (count($annexes) == 1) {
if (1 == count($annexes)) {
$thumbnail = $annexes[0];
$thumbnail['url'] = $annexeUrl . '/' . $datastore['technical_name'] . $thumbnail['paths'][0];
$thumbnail['url'] = $annexeUrl.'/'.$datastore['technical_name'].$thumbnail['paths'][0];
}

return [
'name' => $datasheetName,
'date' => new \DateTime(), // TODO : pour le moment on se sait pas ça correspond à la date de quoi
'categories' => [],
'nb_publications' => $nbPublications,
'thumbnail' => $thumbnail
'thumbnail' => $thumbnail,
];
}

Expand Down Expand Up @@ -203,11 +203,10 @@ public function delete(string $datastoreId, string $datasheetName): Response
}

// TODO : autres données à supprimer

// Suppression des annexes
$annexeUrl = $this->getParameter("annexes_url");

$annexes = $this->entrepotApiService->annexe->getAll($datastoreId, null, null, ["datasheet_name=$datasheetName"]);
foreach($annexes as $annexe) {
foreach ($annexes as $annexe) {
$this->entrepotApiService->annexe->remove($datastoreId, $annexe['_id']);
}

Expand Down

0 comments on commit ff4a50d

Please sign in to comment.