From 1de9ba73a6b77b98e94f797623b80b9d993cf01e Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Thu, 28 Jun 2018 10:42:59 +0200 Subject: [PATCH] Fix the localisations resssource. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- src/Controller/PersonController.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Controller/PersonController.php b/src/Controller/PersonController.php index b452c63..f2e73c1 100644 --- a/src/Controller/PersonController.php +++ b/src/Controller/PersonController.php @@ -85,16 +85,16 @@ class PersonController extends Controller /** * @Rest\Get("/api/person/{id}/localisations") */ - public function getLocalisationActions(Request $request) + public function getLocalisationsAction(Request $request) { $em = $this->getDoctrine()->getManager(); - $localisations = $em->getRepository('App:Localisation')->findBy(['person_id' => $request->get('id')]); + $localisations = $em->getRepository('App:Localisation')->findBy(['person' => $request->get('id')]); if (empty($localisations)) { - return View::create(['message' => 'Person localisation not found'], Response::HTTP_NOT_FOUND); + return View::create(['message' => 'Person localisations not found'], Response::HTTP_NOT_FOUND); } - $view = View::create($localisation); + $view = View::create($localisations); $view->setFormat('json'); $viewHandler = $this->get('fos_rest.view_handler'); -- 2.34.1