fix backend error with AccompanyingCourse endpoints

This commit is contained in:
Mathieu Jaumotte 2021-10-27 16:28:13 +02:00
parent c200e9909e
commit a3b203c306
2 changed files with 4 additions and 7 deletions

View File

@ -26,15 +26,15 @@ class RelationshipApiController extends ApiController
/**
* @Route("/api/1.0/relation/relationship/by-person/{person_id}.json",
* name="chill_relation_relationship_by_person")
*
*
* @ParamConverter("person", options={"id" = "person_id"})
*/
public function getRelationshipsByPerson(Person $person)
{
//TODO: add permissions? (voter?)
$relationships = $this->repository->findByPerson($person);
dump($relationships[0]->getRelation());
//dump($relationships[0]->getRelation());
return $this->json(\array_values($relationships), Response::HTTP_OK, [], ['groups' => [ 'read']]);
}
}
}

View File

@ -41,10 +41,7 @@ services:
tags: ['controller.service_arguments']
Chill\PersonBundle\Controller\AccompanyingCourseApiController:
arguments:
$eventDispatcher: '@Symfony\Contracts\EventDispatcher\EventDispatcherInterface'
$validator: '@Symfony\Component\Validator\Validator\ValidatorInterface'
$registry: '@Symfony\Component\Workflow\Registry'
autowire: true
tags: ['controller.service_arguments']
Chill\PersonBundle\Controller\PersonApiController: