From 7351cb41e606da256a5565b8f3e6d71bca175082 Mon Sep 17 00:00:00 2001 From: Orka Arnest CRUZE Date: Mon, 27 Nov 2023 16:38:27 +0100 Subject: [PATCH] =?UTF-8?q?chore:=20supprime=20code=20comment=C3=A9=20lors?= =?UTF-8?q?=20des=20tests?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Controller/Api/WmsVectorController.php | 2 +- src/Listener/InternalApiSubscriber.php | 1 - src/Services/EntrepotApi/AnnexeApiService.php | 4 +--- 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/Controller/Api/WmsVectorController.php b/src/Controller/Api/WmsVectorController.php index 325377b0..5ad0d1a8 100644 --- a/src/Controller/Api/WmsVectorController.php +++ b/src/Controller/Api/WmsVectorController.php @@ -19,7 +19,7 @@ '/api/datastores/{datastoreId}/stored_data/{storedDataId}/wmsvector', name: 'cartesgouvfr_api_wmsvector_', options: ['expose' => true], - condition: 'request.isXmlHttpRequest()' // TODO : à remettre après les tests + condition: 'request.isXmlHttpRequest()' )] class WmsVectorController extends AbstractController implements ApiControllerInterface { diff --git a/src/Listener/InternalApiSubscriber.php b/src/Listener/InternalApiSubscriber.php index 8cb1de7e..e058eb64 100644 --- a/src/Listener/InternalApiSubscriber.php +++ b/src/Listener/InternalApiSubscriber.php @@ -52,7 +52,6 @@ public function onKernelController(ControllerEvent $event): void /** @var AccessToken */ $accessToken = $session->get(KeycloakToken::SESSION_KEY); - // TODO préciser que c'est l'API interne if (null == $accessToken || (null != $accessToken && $accessToken->hasExpired())) { throw new CartesApiException('Unauthorized', Response::HTTP_UNAUTHORIZED, ['controller' => ApiControllerInterface::class]); diff --git a/src/Services/EntrepotApi/AnnexeApiService.php b/src/Services/EntrepotApi/AnnexeApiService.php index d87daaef..1c1963a3 100644 --- a/src/Services/EntrepotApi/AnnexeApiService.php +++ b/src/Services/EntrepotApi/AnnexeApiService.php @@ -6,10 +6,9 @@ class AnnexeApiService extends AbstractEntrepotApiService { /** * @param array $labels - * @return array */ public function getAll(string $datastoreId, string $mimeType = null, string $path = null, array $labels = null): array - { + { $query = []; if ($mimeType) { $query['mime_type'] = $mimeType; @@ -26,7 +25,6 @@ public function getAll(string $datastoreId, string $mimeType = null, string $pat public function get(string $datastoreId, string $annexeId): array { - // TODO : mettre à jour l'url annexe $annexesUrl = $this->parameters->get('annexes_url'); $response = $this->request('GET', "datastores/$datastoreId/annexes/$annexeId"); $response['paths'][0] = $annexesUrl.$response['paths'][0];