mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-20 22:53:49 +00:00
Merge remote-tracking branch 'origin/master' into features/household-editor
This commit is contained in:
@@ -13,6 +13,7 @@ use Symfony\Component\Serializer\Exception;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
use Chill\MainBundle\CRUD\Controller\ApiController;
|
||||
use Chill\PersonBundle\Household\MembersEditor;
|
||||
use Symfony\Component\Serializer\Normalizer\AbstractNormalizer;
|
||||
|
||||
class HouseholdMemberController extends ApiController
|
||||
{
|
||||
@@ -37,15 +38,10 @@ class HouseholdMemberController extends ApiController
|
||||
//
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
|
||||
// to ensure closing membership before creating one, we must manually open a transaction
|
||||
$em->beginTransaction();
|
||||
|
||||
foreach ($editor->getPersistable() as $el) {
|
||||
$em->persist($el);
|
||||
}
|
||||
|
||||
$em->flush();
|
||||
$em->commit();
|
||||
|
||||
return $this->json($editor->getHousehold(), Response::HTTP_OK, ["groups" => ["read"]]);
|
||||
}
|
||||
|
Reference in New Issue
Block a user