backend: allow to remove people from household, or move to a new household

This commit is contained in:
2021-06-10 13:01:42 +02:00
parent 6fed008ff2
commit 89734c680c
6 changed files with 261 additions and 18 deletions

View File

@@ -55,7 +55,11 @@ class HouseholdMemberController extends ApiController
$em = $this->getDoctrine()->getManager();
// if new household, persist it
if (FALSE === $em->contains($editor->getHousehold())) {
if (
$editor->hasHousehold()
&&
FALSE === $em->contains($editor->getHousehold())
) {
$em->persist($editor->getHousehold());
}