Skip to content

Commit d0dd518

Browse files
committed
#25 fix: RSS and legacy API endpoints
Signed-off-by: Patrizio Bekerle <patrizio@bekerle.com>
1 parent 3df7075 commit d0dd518

File tree

2 files changed

+6
-12
lines changed

2 files changed

+6
-12
lines changed

src/Controller/AppReleaseRSSFeedController.php

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
use Michelf\Markdown;
99
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
1010
use Symfony\Component\HttpFoundation\Response;
11-
use Symfony\Component\Routing\Annotation\Route;
11+
use Symfony\Component\Routing\Attribute\Route;
1212

1313
class AppReleaseRSSFeedController extends AbstractController
1414
{
@@ -18,12 +18,9 @@ class AppReleaseRSSFeedController extends AbstractController
1818
* Returns the RSS feed for the app releases.
1919
*
2020
* http://api.qownnotes.org/rss/app-releases
21-
*
22-
* @Route("/rss/app-releases")
23-
*
24-
* @return Response
2521
*/
26-
public function appReleases(ManagerRegistry $doctrine)
22+
#[Route('/rss/app-releases')]
23+
public function appReleases(ManagerRegistry $doctrine): Response
2724
{
2825
$cacheDriver = ReleaseApi::getCacheDriver();
2926

src/Controller/LegacyApiController.php

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
77
use Symfony\Component\HttpFoundation\JsonResponse;
88
use Symfony\Component\HttpFoundation\RequestStack;
9-
use Symfony\Component\Routing\Annotation\Route;
9+
use Symfony\Component\Routing\Attribute\Route;
1010

1111
class LegacyApiController extends AbstractController
1212
{
@@ -21,13 +21,10 @@ public function __construct(ReleaseApi $api, RequestStack $requestStack)
2121
}
2222

2323
/**
24-
* @Route("/api/v1/last_release/QOwnNotes/{id}.json")
25-
*
26-
* @return JsonResponse
27-
*
2824
* @throws \Exception
2925
*/
30-
public function lastRelease($id)
26+
#[Route('/api/v1/last_release/QOwnNotes/{id}.json')]
27+
public function lastRelease($id): JsonResponse
3128
{
3229
$version = $this->requestStack->getCurrentRequest()->get('v');
3330
$updateMode = $this->requestStack->getCurrentRequest()->get('um');

0 commit comments

Comments
 (0)