feat: ajout de la gestion des commandes pour la suppression des fichiers CBZ et des chapitres, avec création des gestionnaires et des ressources API correspondantes
This commit is contained in:
parent
7fe4ac0d3b
commit
37e1b202c2
@@ -0,0 +1,49 @@
|
||||
<?php
|
||||
|
||||
namespace App\Domain\Manga\Infrastructure\ApiPlatform\Resource;
|
||||
|
||||
use ApiPlatform\Metadata\ApiResource;
|
||||
use ApiPlatform\Metadata\Delete;
|
||||
use App\Domain\Manga\Infrastructure\ApiPlatform\State\Processor\DeleteChapterProcessor;
|
||||
use App\Domain\Manga\Infrastructure\ApiPlatform\State\Provider\DeleteChapterProvider;
|
||||
|
||||
#[ApiResource(
|
||||
shortName: 'Chapters',
|
||||
operations: [
|
||||
new Delete(
|
||||
uriTemplate: '/manga/chapters/{id}',
|
||||
provider: DeleteChapterProvider::class,
|
||||
processor: DeleteChapterProcessor::class,
|
||||
name: 'delete_chapter',
|
||||
openapiContext: [
|
||||
'summary' => 'Delete a chapter (soft delete)',
|
||||
'description' => 'Marks a chapter as deleted by setting its visibility to false',
|
||||
'parameters' => [
|
||||
[
|
||||
'name' => 'id',
|
||||
'in' => 'path',
|
||||
'required' => true,
|
||||
'schema' => [
|
||||
'type' => 'string'
|
||||
],
|
||||
'description' => 'The chapter ID'
|
||||
]
|
||||
],
|
||||
'responses' => [
|
||||
'204' => [
|
||||
'description' => 'Chapter successfully deleted'
|
||||
],
|
||||
'404' => [
|
||||
'description' => 'Chapter not found'
|
||||
]
|
||||
]
|
||||
]
|
||||
)
|
||||
]
|
||||
)]
|
||||
class DeleteChapterResource
|
||||
{
|
||||
public function __construct(
|
||||
public string $id
|
||||
) {}
|
||||
}
|
||||
Reference in New Issue
Block a user