| @@ -7,7 +7,8 @@ | |||||
| namespace App\ApiResource; | namespace App\ApiResource; | ||||
| use ApiPlatform\Doctrine\Odm\Filter\OrderFilter; | |||||
| use ApiPlatform\Doctrine\Orm\Filter\OrderFilter; | |||||
| use ApiPlatform\Doctrine\Orm\State\Options; | use ApiPlatform\Doctrine\Orm\State\Options; | ||||
| use ApiPlatform\Metadata\ApiFilter; | use ApiPlatform\Metadata\ApiFilter; | ||||
| use ApiPlatform\Metadata\ApiProperty; | use ApiPlatform\Metadata\ApiProperty; | ||||
| @@ -41,11 +42,12 @@ use Symfony\Component\Validator\Constraints\NotBlank; | |||||
| security: 'is_granted("ROLE_ADMIN")', | security: 'is_granted("ROLE_ADMIN")', | ||||
| ) | ) | ||||
| ], | ], | ||||
| order: ['name' => 'ASC'], | |||||
| paginationItemsPerPage: 10, | paginationItemsPerPage: 10, | ||||
| security: 'is_granted("ROLE_USER")', | security: 'is_granted("ROLE_USER")', | ||||
| provider: EntityToDtoStateProvider::class, | provider: EntityToDtoStateProvider::class, | ||||
| processor: EntityClassDtoStateProcessor::class, | processor: EntityClassDtoStateProcessor::class, | ||||
| stateOptions: new Options(entityClass: Partner::class), | |||||
| stateOptions: new Options(entityClass: Partner::class) | |||||
| )] | )] | ||||
| #[ApiFilter(OrderFilter::class, properties: ['name'], arguments: ['orderParameterName' => 'order'])] | #[ApiFilter(OrderFilter::class, properties: ['name'], arguments: ['orderParameterName' => 'order'])] | ||||
| class PartnerApi | class PartnerApi | ||||