feat: ajout de la fonctionnalité de suppression de mangas, incluant une modale de confirmation pour l'utilisateur, la gestion des erreurs et l'intégration avec l'API pour supprimer les mangas et leurs chapitres associés. Mise à jour des composants Vue et ajout de tests pour valider cette nouvelle fonctionnalité.
This commit is contained in:
parent
7f9d583c94
commit
f09f744a9b
@@ -0,0 +1,48 @@
|
||||
<?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;
|
||||
|
||||
#[ApiResource(
|
||||
shortName: 'Manga',
|
||||
operations: [
|
||||
new Delete(
|
||||
uriTemplate: '/mangas/{id}',
|
||||
processor: DeleteMangaProcessor::class,
|
||||
name: 'delete_manga',
|
||||
read: false,
|
||||
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
|
||||
) {}
|
||||
}
|
||||
Reference in New Issue
Block a user