Commit 3c9f0a3a authored by Mat's avatar Mat
Browse files

[non testé] groupes de serialization

parent 956007af
...@@ -246,7 +246,7 @@ class LegumeAPIController extends MasterAPIController ...@@ -246,7 +246,7 @@ class LegumeAPIController extends MasterAPIController
{ {
$em->persist($offrelegumes); $em->persist($offrelegumes);
$em->flush(); $em->flush();
return $this->api($offrelegumes); return $this->api($offrelegumes, 200, array('readOffreLegumes'));
} }
return $this->api($form, Response::HTTP_BAD_REQUEST); return $this->api($form, Response::HTTP_BAD_REQUEST);
} }
......
...@@ -58,7 +58,7 @@ class OffreAPIController extends MasterAPIController ...@@ -58,7 +58,7 @@ class OffreAPIController extends MasterAPIController
$em = $this->getDoctrine()->getManager(); $em = $this->getDoctrine()->getManager();
$em->persist($offre); $em->persist($offre);
$em->flush(); // TODO bug -> Notice: Array to string conversion $em->flush(); // TODO bug -> Notice: Array to string conversion
return $this->api($offre); return $this->api($offre, 200, array('readOffres'));
} }
return $this->api($form , Response::HTTP_BAD_REQUEST); return $this->api($form , Response::HTTP_BAD_REQUEST);
} }
...@@ -89,7 +89,7 @@ class OffreAPIController extends MasterAPIController ...@@ -89,7 +89,7 @@ class OffreAPIController extends MasterAPIController
if ($offre === null) { if ($offre === null) {
return $this->api('Not found', Response::HTTP_NOT_FOUND); return $this->api('Not found', Response::HTTP_NOT_FOUND);
} }
return $this->api($offre); return $this->api($offre, 200, array('readOffres'));
} }
...@@ -114,7 +114,7 @@ class OffreAPIController extends MasterAPIController ...@@ -114,7 +114,7 @@ class OffreAPIController extends MasterAPIController
if ($form->isSubmitted() && $form->isValid()) if ($form->isSubmitted() && $form->isValid())
{ {
$em->flush(); $em->flush();
return $this->api($offre); return $this->api($offre, 200, array('readOffres'));
} }
return $this->api($form, Response::HTTP_BAD_REQUEST); return $this->api($form, Response::HTTP_BAD_REQUEST);
} }
...@@ -141,7 +141,7 @@ class OffreAPIController extends MasterAPIController ...@@ -141,7 +141,7 @@ class OffreAPIController extends MasterAPIController
if ($form->isSubmitted() && $form->isValid()) if ($form->isSubmitted() && $form->isValid())
{ {
$em->flush(); $em->flush();
return $this->api($offre); return $this->api($offre, 200, array('readOffres'));
} }
return $this->api($form, Response::HTTP_BAD_REQUEST); return $this->api($form, Response::HTTP_BAD_REQUEST);
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment