From: Jérôme Benoit Date: Wed, 27 Jun 2018 20:17:18 +0000 (+0200) Subject: Enable @Rest\View annotations. X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=9e71bdc54747a36c661ce304a330a2d6dc43b80c;p=Project_proches_de_moi-server.git Enable @Rest\View annotations. Signed-off-by: Jérôme Benoit --- diff --git a/src/Controller/PersonController.php b/src/Controller/PersonController.php index af3c28a..6ee3fdf 100644 --- a/src/Controller/PersonController.php +++ b/src/Controller/PersonController.php @@ -98,17 +98,17 @@ class PersonController extends FOSRestController } /** + * @Rest\View() * @Rest\Get( * path = "/api/person/{id}", * name = "show_person", * requirements = {"id"="\d+"} * ) - * @Rest\View() */ public function showPerson(Request $request) { $em = $this->getDoctrine()->getManager(); - $person = $em->getRepository('App::Person')->find($request->get('id')); + $person = $em->getRepository('App:Person')->find($request->get('id')); if (empty($person)) { return new JsonResponse(['message' => 'Person not found'], Response::HTTP_NOT_FOUND); @@ -148,7 +148,7 @@ class PersonController extends FOSRestController public function showPersonFriends(Request $request) { $em = $this->getDoctrine()->getManager(); - $person = $em->getRepository('App::Person')->find($request->get('id')); + $person = $em->getRepository('App:Person')->find($request->get('id')); if (empty($person)) { return new JsonResponse(['message' => 'Person not found'], Response::HTTP_NOT_FOUND);