mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-25 19:28:51 +02:00
Allow to filter attachments API response by attachment types
This commit is contained in:
parent
0e75d76720
commit
e09f60e71f
2 changed files with 2 additions and 0 deletions
0
src/ApiResource/.gitignore
vendored
0
src/ApiResource/.gitignore
vendored
|
@ -33,6 +33,7 @@ use ApiPlatform\Metadata\GetCollection;
|
||||||
use ApiPlatform\Metadata\Patch;
|
use ApiPlatform\Metadata\Patch;
|
||||||
use ApiPlatform\Metadata\Post;
|
use ApiPlatform\Metadata\Post;
|
||||||
use App\ApiPlatform\DocumentedAPIProperty;
|
use App\ApiPlatform\DocumentedAPIProperty;
|
||||||
|
use App\ApiPlatform\Filter\EntityFilter;
|
||||||
use App\ApiPlatform\Filter\LikeFilter;
|
use App\ApiPlatform\Filter\LikeFilter;
|
||||||
use App\Repository\AttachmentRepository;
|
use App\Repository\AttachmentRepository;
|
||||||
use App\EntityListeners\AttachmentDeleteListener;
|
use App\EntityListeners\AttachmentDeleteListener;
|
||||||
|
@ -84,6 +85,7 @@ use LogicException;
|
||||||
#[DocumentedAPIProperty(schemaName: 'Attachment-Read', property: 'thumbnail_url', type: 'string', nullable: true,
|
#[DocumentedAPIProperty(schemaName: 'Attachment-Read', property: 'thumbnail_url', type: 'string', nullable: true,
|
||||||
description: 'The URL to a thumbnail version of this file. This only exists for internal picture attachments.')]
|
description: 'The URL to a thumbnail version of this file. This only exists for internal picture attachments.')]
|
||||||
#[ApiFilter(LikeFilter::class, properties: ["name"])]
|
#[ApiFilter(LikeFilter::class, properties: ["name"])]
|
||||||
|
#[ApiFilter(EntityFilter::class, properties: ["attachment_type"])]
|
||||||
#[ApiFilter(DateFilter::class, strategy: DateFilter::EXCLUDE_NULL)]
|
#[ApiFilter(DateFilter::class, strategy: DateFilter::EXCLUDE_NULL)]
|
||||||
#[ApiFilter(OrderFilter::class, properties: ['name', 'id', 'addedDate', 'lastModified'])]
|
#[ApiFilter(OrderFilter::class, properties: ['name', 'id', 'addedDate', 'lastModified'])]
|
||||||
abstract class Attachment extends AbstractNamedDBElement
|
abstract class Attachment extends AbstractNamedDBElement
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue