Files
Mangarr/src/Domain/Manga/Infrastructure/ApiPlatform/Resource/DeleteMangaResource.php
ext.jeremy.guillot@maxicoffee.domains b5a832fbbc
All checks were successful
Build and Deploy / deploy (push) Successful in 1m2s
fix: delete manga
2026-02-11 16:27:11 +01:00

50 lines
1.5 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\DeleteMangaProcessor;
use App\Domain\Manga\Infrastructure\ApiPlatform\State\Provider\DeleteMangaProvider;
#[ApiResource(
shortName: 'Manga',
operations: [
new Delete(
uriTemplate: '/mangas/{id}',
provider: DeleteMangaProvider::class,
processor: DeleteMangaProcessor::class,
name: 'delete_manga',
openapiContext: [
'summary' => 'Delete a manga',
'description' => 'Permanently deletes a manga and all its associated chapters',
'parameters' => [
[
'name' => 'id',
'in' => 'path',
'required' => true,
'schema' => [
'type' => 'string'
],
'description' => 'The manga ID'
]
],
'responses' => [
'204' => [
'description' => 'Manga successfully deleted'
],
'404' => [
'description' => 'Manga not found'
]
]
]
)
]
)]
class DeleteMangaResource
{
public function __construct(
public string $id
) {}
}