mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2026-07-27 19:51:38 +00:00
Merged subchildren operations on APIPlatform into one APIResource, as havinng multiple is deprecated
This commit is contained in:
parent
188444b30f
commit
0eba7121aa
11 changed files with 67 additions and 139 deletions
|
|
@ -71,21 +71,16 @@ use Symfony\Component\Validator\Constraints as Assert;
|
|||
new Post(securityPostDenormalize: 'is_granted("create", object)'),
|
||||
new Patch(security: 'is_granted("edit", object)'),
|
||||
new Delete(security: 'is_granted("delete", object)'),
|
||||
new GetCollection(
|
||||
uriTemplate: '/suppliers/{id}/children.{_format}',
|
||||
uriVariables: ['id' => new Link(fromProperty: 'children', fromClass: Supplier::class)],
|
||||
openapi: new Operation(summary: 'Retrieves the children elements of a supplier.'),
|
||||
security: 'is_granted("@manufacturers.read")'
|
||||
),
|
||||
],
|
||||
normalizationContext: ['groups' => ['supplier:read', 'company:read', 'api:basic:read'], 'openapi_definition_name' => 'Read'],
|
||||
denormalizationContext: ['groups' => ['supplier:write', 'company:write', 'api:basic:write', 'attachment:write', 'parameter:write'], 'openapi_definition_name' => 'Write'],
|
||||
)]
|
||||
#[ApiResource(
|
||||
uriTemplate: '/suppliers/{id}/children.{_format}',
|
||||
operations: [new GetCollection(
|
||||
openapi: new Operation(summary: 'Retrieves the children elements of a supplier.'),
|
||||
security: 'is_granted("@manufacturers.read")'
|
||||
)],
|
||||
uriVariables: [
|
||||
'id' => new Link(fromProperty: 'children', fromClass: Supplier::class)
|
||||
],
|
||||
normalizationContext: ['groups' => ['supplier:read', 'company:read', 'api:basic:read'], 'openapi_definition_name' => 'Read']
|
||||
)]
|
||||
#[ApiFilter(PropertyFilter::class)]
|
||||
#[ApiFilter(LikeFilter::class, properties: ["name", "comment"])]
|
||||
#[ApiFilter(DateFilter::class, strategy: DateFilterInterface::EXCLUDE_NULL)]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue