endpoints created for profession and civility for use in vue component

This commit is contained in:
Julie Lenaerts 2022-01-13 14:33:57 +01:00
parent c2dec360b1
commit bf9469d538
6 changed files with 54 additions and 2 deletions

View File

@ -559,6 +559,20 @@ class ChillMainExtension extends Extension implements
],
],
],
[
'class' => \Chill\MainBundle\Entity\Civility::class,
'name' => 'civility',
'base_path' => '/api/1.0/main/civility',
'base_role' => 'ROLE_USER',
'actions' => [
'_index' => [
'methods' => [
Request::METHOD_GET => true,
Request::METHOD_HEAD => true,
],
],
],
],
],
]);
}

View File

@ -29,6 +29,7 @@ class Civility
/**
* @ORM\Column(type="boolean")
* @Serializer\Groups({"read"})
*/
private bool $active = true;

View File

@ -781,6 +781,16 @@ paths:
description: "accepted"
403:
description: "unauthorized"
/1.0/main/civility.json:
get:
tags:
- civility
summary: Return all civility types
responses:
200:
description: "ok"
401:
description: "Unauthorized"
/1.0/main/user-job.json:
get:
tags:

View File

@ -126,6 +126,21 @@ class ChillThirdPartyExtension extends Extension implements PrependExtensionInte
],
],
],
[
'class' => \Chill\ThirdPartyBundle\Entity\ThirdPartyProfession::class,
// 'controller' => \Chill\MainBundle\Controller\ProfessionApiController::class,
'name' => 'profession',
'base_path' => '/api/1.0/thirdparty/professions',
'base_role' => 'ROLE_USER',
'actions' => [
'_index' => [
'methods' => [
Request::METHOD_GET => true,
Request::METHOD_HEAD => true,
],
],
],
],
],
]);
}

View File

@ -23,6 +23,7 @@ class ThirdPartyProfession
{
/**
* @ORM\Column(type="boolean")
* @Serializer\Groups({"read"})
*/
private bool $active = true;
@ -30,13 +31,13 @@ class ThirdPartyProfession
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
* @Serializer\Groups({"docgen:read"})
* @Serializer\Groups({"docgen:read", "read"})
*/
private ?int $id = null;
/**
* @ORM\Column(type="json")
* @Serializer\Groups({"docgen:read"})
* @Serializer\Groups({"docgen:read", "read"})
*/
private array $name = [];

View File

@ -110,3 +110,14 @@ paths:
description: "OK"
422:
description: "Object with validation errors"
/1.0/thirdparty/professions.json:
get:
tags:
- thirdparty
summary: Return all thirdparty professions
responses:
200:
description: "ok"
401:
description: "Unauthorized"