mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-07-13 11:54:32 +02:00
Fixed API Platform deprecations
This commit is contained in:
parent
d0a5b4dcd7
commit
717a9fb0a3
18 changed files with 72 additions and 29 deletions
|
@ -33,6 +33,7 @@ use ApiPlatform\Metadata\GetCollection;
|
|||
use ApiPlatform\Metadata\Link;
|
||||
use ApiPlatform\Metadata\Patch;
|
||||
use ApiPlatform\Metadata\Post;
|
||||
use ApiPlatform\OpenApi\Model\Operation;
|
||||
use ApiPlatform\Serializer\Filter\PropertyFilter;
|
||||
use App\ApiPlatform\Filter\LikeFilter;
|
||||
use App\Entity\Attachments\Attachment;
|
||||
|
@ -75,8 +76,10 @@ use Symfony\Component\Validator\Constraints as Assert;
|
|||
#[ApiResource(
|
||||
uriTemplate: '/currencies/{id}/children.{_format}',
|
||||
operations: [
|
||||
new GetCollection(openapiContext: ['summary' => 'Retrieves the children elements of a currency.'],
|
||||
security: 'is_granted("@currencies.read")')
|
||||
new GetCollection(
|
||||
openapi: new Operation(summary: 'Retrieves the children elements of a currency.'),
|
||||
security: 'is_granted("@currencies.read")'
|
||||
)
|
||||
],
|
||||
uriVariables: [
|
||||
'id' => new Link(fromProperty: 'children', fromClass: Currency::class)
|
||||
|
|
|
@ -34,6 +34,7 @@ use ApiPlatform\Metadata\GetCollection;
|
|||
use ApiPlatform\Metadata\Link;
|
||||
use ApiPlatform\Metadata\Patch;
|
||||
use ApiPlatform\Metadata\Post;
|
||||
use ApiPlatform\OpenApi\Model\Operation;
|
||||
use ApiPlatform\Serializer\Filter\PropertyFilter;
|
||||
use App\ApiPlatform\Filter\LikeFilter;
|
||||
use Doctrine\DBAL\Types\Types;
|
||||
|
@ -73,8 +74,10 @@ use Symfony\Component\Validator\Constraints as Assert;
|
|||
#[ApiResource(
|
||||
uriTemplate: '/parts/{id}/orderdetails.{_format}',
|
||||
operations: [
|
||||
new GetCollection(openapiContext: ['summary' => 'Retrieves the orderdetails of a part.'],
|
||||
security: 'is_granted("@parts.read")')
|
||||
new GetCollection(
|
||||
openapi: new Operation(summary: 'Retrieves the orderdetails of a part.'),
|
||||
security: 'is_granted("@parts.read")'
|
||||
)
|
||||
],
|
||||
uriVariables: [
|
||||
'id' => new Link(toProperty: 'part', fromClass: Part::class)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue