mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-21 07:03:49 +00:00
GET for relationship fixed: associated relation displayed
This commit is contained in:
@@ -23,12 +23,6 @@ class RelationshipApiController extends ApiController
|
||||
$this->repository = $repository;
|
||||
}
|
||||
|
||||
public function createEntity(string $action, Request $request): object
|
||||
{
|
||||
$relationship = parent::createEntity($action, $request);
|
||||
return $relationship;
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route("/api/1.0/relation/relationship/by-person/{person_id}.json",
|
||||
* name="chill_relation_relationship_by_person")
|
||||
@@ -39,6 +33,7 @@ class RelationshipApiController extends ApiController
|
||||
{
|
||||
//TODO: add permissions? (voter?)
|
||||
$relationships = $this->repository->findByPerson($person);
|
||||
dump($relationships[0]->getRelation());
|
||||
|
||||
return $this->json(\array_values($relationships), Response::HTTP_OK, [], ['groups' => [ 'read']]);
|
||||
}
|
||||
|
Reference in New Issue
Block a user