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

@@ -28,6 +28,10 @@ export const useContentSourceStore = defineStore('contentSource', {
// Health check state
checkingHealth: false,
checkHealthError: null,
// Delete state
deleting: false,
deleteError: null,
}),
getters: {
@@ -172,6 +176,28 @@ export const useContentSourceStore = defineStore('contentSource', {
}
},
// Delete a source
async deleteSource(id) {
if (this.deleting) return;
this.deleting = true;
this.deleteError = null;
try {
await contentSourceRepository.delete(id);
this.sources = this.sources.filter(source => source.id !== id);
if (this.currentSource && this.currentSource.id === id) {
this.currentSource = null;
}
} catch (error) {
this.deleteError = error.message;
console.error('Erreur lors de la suppression de la source:', error);
throw error;
} finally {
this.deleting = false;
}
},
// Clear current source
clearCurrentSource() {
this.currentSource = null;