From 53d18c7748f09a4e3b6033366a19c1e09989d784 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Wed, 29 Nov 2023 13:22:51 +0100 Subject: [PATCH] Give a more obvious url for new/current api endpoint --- .../ChillMainBundle/Controller/NewsItemApiController.php | 6 +++--- src/Bundle/ChillMainBundle/chill.api.specs.yaml | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Bundle/ChillMainBundle/Controller/NewsItemApiController.php b/src/Bundle/ChillMainBundle/Controller/NewsItemApiController.php index 5224228a8..6df54c779 100644 --- a/src/Bundle/ChillMainBundle/Controller/NewsItemApiController.php +++ b/src/Bundle/ChillMainBundle/Controller/NewsItemApiController.php @@ -30,15 +30,15 @@ class NewsItemApiController /** * Get list of news items filtered on start and end date. * - * @Route("/api/1.0/main/news.json", methods={"get"}) + * @Route("/api/1.0/main/news/current.json", methods={"get"}) */ public function listCurrentNewsItems(): JsonResponse { $total = $this->newsItemRepository->countWithDateFilter(); $paginator = $this->paginatorFactory->create($total); $newsItems = $this->newsItemRepository->findWithDateFilter( - $limit = $paginator->getItemsPerPage(), - $offset = $paginator->getCurrentPage()->getFirstItemNumber() + $paginator->getItemsPerPage(), + $paginator->getCurrentPage()->getFirstItemNumber() ); return new JsonResponse($this->serializer->serialize( diff --git a/src/Bundle/ChillMainBundle/chill.api.specs.yaml b/src/Bundle/ChillMainBundle/chill.api.specs.yaml index 8edbd93f6..f37ee723d 100644 --- a/src/Bundle/ChillMainBundle/chill.api.specs.yaml +++ b/src/Bundle/ChillMainBundle/chill.api.specs.yaml @@ -892,11 +892,11 @@ paths: 403: description: "Unauthorized" - /1.0/main/news.json: + /1.0/main/news/current.json: get: tags: - news items - summary: Returns a list of news items + summary: Returns a list of news items which are valid responses: 200: description: "ok"