repositories
/
Project_proches_de_moi-server.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Enable @Rest\View annotations.
[Project_proches_de_moi-server.git]
/
src
/
Controller
/
PersonController.php
diff --git
a/src/Controller/PersonController.php
b/src/Controller/PersonController.php
index af3c28a95e4ced170dac009a82e1826aa81fc01e..6ee3fdfc52ba561a8c42e872b1820e9abf35ed57 100644
(file)
--- 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\Get(
* path = "/api/person/{id}",
* name = "show_person",
* requirements = {"id"="\d+"}
* )
- * @Rest\View()
*/
public function showPerson(Request $request)
{
$em = $this->getDoctrine()->getManager();
*/
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);
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();
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);
if (empty($person)) {
return new JsonResponse(['message' => 'Person not found'], Response::HTTP_NOT_FOUND);