fix: household api

This commit is contained in:
Julien Fastré 2021-06-22 15:31:56 +02:00
parent c04ccef4cd
commit 34d6452286

View File

@ -553,7 +553,6 @@ class ChillPersonExtension extends Extension implements PrependExtensionInterfac
'methods' => [
Request::METHOD_GET => true,
Request::METHOD_HEAD => true,
Request::METHOD_POST=> true,
]
],
'address' => [
@ -567,25 +566,6 @@ class ChillPersonExtension extends Extension implements PrependExtensionInterfac
],
]
],
[
'class' => \Chill\PersonBundle\Entity\Household\Household::class,
'name' => 'household',
'base_path' => '/api/1.0/person/household',
// TODO: acl
'base_role' => 'ROLE_USER',
'actions' => [
'_entity' => [
'methods' => [
Request::METHOD_GET => true,
Request::METHOD_HEAD => true,
],
'roles' => [
Request::METHOD_GET => 'ROLE_USER',
Request::METHOD_HEAD => 'ROLE_USER',
]
],
]
],
[
'class' => \Chill\PersonBundle\Entity\SocialWork\SocialAction::class,
'name' => 'social_action',
@ -629,6 +609,85 @@ class ChillPersonExtension extends Extension implements PrependExtensionInterfac
]
]
],
[
'class' => \Chill\PersonBundle\Entity\AccompanyingPeriod\AccompanyingPeriodWork::class,
'name' => 'accompanying_period_work',
'base_path' => '/api/1.0/person/accompanying-course/work',
'controller' => \Chill\PersonBundle\Controller\AccompanyingCourseWorkApiController::class,
// TODO: acl
'base_role' => 'ROLE_USER',
'actions' => [
'_entity' => [
'methods' => [
Request::METHOD_GET => true,
Request::METHOD_HEAD => true,
Request::METHOD_PATCH => true,
Request::METHOD_PUT => true,
],
'roles' => [
Request::METHOD_GET => 'ROLE_USER',
Request::METHOD_HEAD => 'ROLE_USER',
Request::METHOD_PATCH => 'ROLE_USER',
Request::METHOD_PUT => 'ROLE_USER',
]
],
]
],
[
'class' => \Chill\PersonBundle\Entity\SocialWork\Result::class,
'controller' => \Chill\PersonBundle\Controller\SocialWorkResultApiController::class,
'name' => 'social_work_result',
'base_path' => '/api/1.0/person/social-work/result',
'base_role' => 'ROLE_USER',
'actions' => [
'_entity' => [
'methods' => [
Request::METHOD_GET => true,
Request::METHOD_HEAD => true,
],
'roles' => [
Request::METHOD_GET => 'ROLE_USER',
Request::METHOD_HEAD => 'ROLE_USER',
]
],
'_index' => [
'methods' => [
Request::METHOD_GET => true,
Request::METHOD_HEAD => true,
],
'roles' => [
Request::METHOD_GET => 'ROLE_USER',
Request::METHOD_HEAD => 'ROLE_USER',
]
],
'by-social-action' => [
'single-collection' => 'collection',
'path' => '/by-social-action/{id}.{_format}',
'controller_action' => 'listBySocialAction',
'methods' => [
Request::METHOD_GET => true,
Request::METHOD_HEAD => true,
],
'roles' => [
Request::METHOD_GET => 'ROLE_USER',
Request::METHOD_HEAD => 'ROLE_USER',
]
],
'by-goal' => [
'single-collection' => 'collection',
'path' => '/by-goal/{id}.{_format}',
'controller_action' => 'listByGoal',
'methods' => [
Request::METHOD_GET => true,
Request::METHOD_HEAD => true,
],
'roles' => [
Request::METHOD_GET => 'ROLE_USER',
Request::METHOD_HEAD => 'ROLE_USER',
]
],
]
],
]
]);
}