Files
Mangarr/src/Domain/Manga/Infrastructure/ApiPlatform/Resource/DeleteChapterResource.php
ext.jeremy.guillot@maxicoffee.domains 7506a7a3c1 style: apply php-cs-fixer formatting (PSR-12)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-09 20:46:59 +01:00

51 lines
1.6 KiB
PHP

<?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
) {
}
}