feat(setting): implémenter la suppression d'une ContentSource

- Ajoute DeleteContentSourceCommand + CommandHandler (CQRS)
- Expose DELETE /api/content-sources/{id} via API Platform (Resource, Provider, Processor)
- Ajoute 2 tests Feature (204 succès, 404 not found)
- Frontend : méthode delete() dans le repository, action deleteSource() dans le store
- Nouveau composant ContentSourceDeleteModal (modale de confirmation)
- Bouton Supprimer dans la toolbar de ScrapperEdit (visible en mode édition uniquement)
This commit is contained in:
ext.jeremy.guillot@maxicoffee.domains
2026-03-16 00:27:31 +01:00
parent 36f873aaca
commit fc4ab68e8b
10 changed files with 401 additions and 0 deletions

View File

@@ -0,0 +1,50 @@
<?php
namespace App\Domain\Setting\Infrastructure\ApiPlatform\Resource;
use ApiPlatform\Metadata\ApiResource;
use ApiPlatform\Metadata\Delete;
use App\Domain\Setting\Infrastructure\ApiPlatform\State\Processor\DeleteContentSourceStateProcessor;
use App\Domain\Setting\Infrastructure\ApiPlatform\State\Provider\DeleteContentSourceStateProvider;
#[ApiResource(
shortName: 'ContentSource',
operations: [
new Delete(
uriTemplate: '/content-sources/{id}',
provider: DeleteContentSourceStateProvider::class,
processor: DeleteContentSourceStateProcessor::class,
name: 'delete_content_source',
openapiContext: [
'summary' => 'Delete a content source',
'description' => 'Permanently deletes a content source',
'parameters' => [
[
'name' => 'id',
'in' => 'path',
'required' => true,
'schema' => [
'type' => 'integer'
],
'description' => 'The content source ID'
]
],
'responses' => [
'204' => [
'description' => 'Content source successfully deleted'
],
'404' => [
'description' => 'Content source not found'
]
]
]
)
]
)]
class DeleteContentSourceResource
{
public function __construct(
public int $id
) {
}
}