Merge remote-tracking branch 'origin/master' into features/household-editor

This commit is contained in:
2021-06-07 17:32:29 +02:00
64 changed files with 1626 additions and 460 deletions

View File

@@ -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"]]);
}