remove route for testing move

This commit is contained in:
2021-06-10 13:02:35 +02:00
parent 89734c680c
commit 3e39dd9a1e
2 changed files with 0 additions and 85 deletions

View File

@@ -71,49 +71,6 @@ class HouseholdMemberController extends ApiController
return $this->json($editor->getHousehold(), Response::HTTP_OK, [], ["groups" => ["read"]]);
}
/**
* @Route(
* "/api/1.0/person/household/members/move/test.{_format}",
* name="chill_api_person_household_members_move_test"
* )
*/
public function test(Request $request, $_format): Response
{
try {
$editor = $this->getSerializer()
->deserialize($request->getContent(), MembersEditor::class,
$_format, ['groups' => [ "read" ]]);
} catch (Exception\InvalidArgumentException | Exception\UnexpectedValueException $e) {
throw new BadRequestException("Deserialization error: {$e->getMessage()}", 45896, $e);
}
// TODO ACL
//
// TODO validation
// temporary, to have at least one problem for testing purpose
/*$violations = [
new \Symfony\Component\Validator\ConstraintViolation(
"This is a fake message",
null,
[],
$editor->getHousehold(),
'household.members.startDate',
new \DateTime('10 years ago')
),
new \Symfony\Component\Validator\ConstraintViolation(
"This is another fake message",
null,
[],
$editor->getHousehold(),
'household.members.endDate',
new \DateTime('10 years ago')
)
];
$violationsList = new \Symfony\Component\Validator\ConstraintViolationList($violations);
*/
return $this->json($editor->getHousehold(), Response::HTTP_OK, ["groups" => ["read"]]);
}
/**
* @Route(
* "/{_locale}/person/household/members/editor",