mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-06 07:49:53 +00:00
Give a more obvious url for new/current api endpoint
This commit is contained in:
parent
8bbe094e70
commit
53d18c7748
@ -30,15 +30,15 @@ class NewsItemApiController
|
|||||||
/**
|
/**
|
||||||
* Get list of news items filtered on start and end date.
|
* 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
|
public function listCurrentNewsItems(): JsonResponse
|
||||||
{
|
{
|
||||||
$total = $this->newsItemRepository->countWithDateFilter();
|
$total = $this->newsItemRepository->countWithDateFilter();
|
||||||
$paginator = $this->paginatorFactory->create($total);
|
$paginator = $this->paginatorFactory->create($total);
|
||||||
$newsItems = $this->newsItemRepository->findWithDateFilter(
|
$newsItems = $this->newsItemRepository->findWithDateFilter(
|
||||||
$limit = $paginator->getItemsPerPage(),
|
$paginator->getItemsPerPage(),
|
||||||
$offset = $paginator->getCurrentPage()->getFirstItemNumber()
|
$paginator->getCurrentPage()->getFirstItemNumber()
|
||||||
);
|
);
|
||||||
|
|
||||||
return new JsonResponse($this->serializer->serialize(
|
return new JsonResponse($this->serializer->serialize(
|
||||||
|
@ -892,11 +892,11 @@ paths:
|
|||||||
403:
|
403:
|
||||||
description: "Unauthorized"
|
description: "Unauthorized"
|
||||||
|
|
||||||
/1.0/main/news.json:
|
/1.0/main/news/current.json:
|
||||||
get:
|
get:
|
||||||
tags:
|
tags:
|
||||||
- news items
|
- news items
|
||||||
summary: Returns a list of news items
|
summary: Returns a list of news items which are valid
|
||||||
responses:
|
responses:
|
||||||
200:
|
200:
|
||||||
description: "ok"
|
description: "ok"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user