Skip to content

Commit

Permalink
refactor: remove class level route definition
Browse files Browse the repository at this point in the history
  • Loading branch information
siganushka committed Sep 19, 2024
1 parent 5b65e34 commit 995ddf9
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/Controller/RegionController.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,13 @@
/**
* @psalm-suppress PropertyNotSetInConstructor
*/
#[Route('/regions')]
class RegionController extends AbstractController
{
public function __construct(protected readonly RegionRepository $regionRepository)
{
}

#[Route(methods: 'GET')]
#[Route('/regions', methods: 'GET')]
public function getCollection(Request $request): Response
{
$parent = $request->query->get('parent');
Expand All @@ -34,7 +33,7 @@ public function getCollection(Request $request): Response
return $this->createResponse($regions);
}

#[Route('/{code}', methods: 'GET')]
#[Route('/regions/{code}', methods: 'GET')]
public function getItem(string $code): Response
{
$entity = $this->regionRepository->find($code);
Expand Down

0 comments on commit 995ddf9

Please sign in to comment.