Commit b0c49d46 authored by Mat's avatar Mat

api, ajoute un groupe de sérialisation pour limiter la profondeur du json

parent e340555b
......@@ -141,7 +141,7 @@ class InfoAPIController extends MasterAPIController
}
$em->flush();
return $this->api($info);
return $this->api($info, 200, array('readInfos'));
}
return $this->api($form, Response::HTTP_BAD_REQUEST);
}
......
......@@ -58,7 +58,7 @@ class LettreAPIController extends MasterAPIController
$em->persist($lettre);
$em->flush();
return $this->api($lettre);
return $this->api($lettre, 200, array('readLettres'));
}
return $this->api($form, Response::HTTP_BAD_REQUEST);
}
......@@ -88,7 +88,7 @@ class LettreAPIController extends MasterAPIController
if ($lettre === null) {
return $this->api('Not found', Response::HTTP_NOT_FOUND);
}
return $this->api($lettre);
return $this->api($lettre, 200, array('readLettres'));
}
......@@ -113,7 +113,7 @@ class LettreAPIController extends MasterAPIController
if ($form->isSubmitted() && $form->isValid())
{
$em->flush();
return $this->api($lettre);
return $this->api($lettre, 200, array('readLettres'));
}
return $this->api($form, Response::HTTP_BAD_REQUEST);
}
......@@ -140,7 +140,7 @@ class LettreAPIController extends MasterAPIController
if ($form->isSubmitted() && $form->isValid())
{
$em->flush();
return $this->api($lettre);
return $this->api($lettre, 200, array('readLettres'));
}
return $this->api($form, Response::HTTP_BAD_REQUEST);
}
......@@ -211,7 +211,7 @@ class LettreAPIController extends MasterAPIController
if ($form->isSubmitted() && $form->isValid())
{
$em->flush();
return $this->api([]);
return $this->api($lettre, 200, array('readLettres'));
}
return $this->api($form, Response::HTTP_BAD_REQUEST);
}
......
......@@ -18,7 +18,7 @@ class SendMailCommand extends ContainerAwareCommand
{
$this
->setName('potage:mail:send')
->setDescription("Envoie un biess mail !");
->setDescription("Test d'envoi d'une infolettre!");
}
public $newsletter;
......
......@@ -60,6 +60,7 @@ class DefaultController extends MasterController
if ($form->isSubmitted() && $form->isValid())
{
$retour = $newsletter->sendLettreToGroup($lettre);
}
return $this->render('@Potage/Default/test.html.twig', array(
......
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