Update frontend/src/components/source/SourceDetailContent.tsx

Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
This commit is contained in:
Luis Novo 2025-12-19 22:48:09 -03:00 committed by GitHub
parent c7de8ecd86
commit 8fdb0f0539
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -782,10 +782,15 @@ export function SourceDetailContent({
}}
insight={selectedInsight ?? undefined}
onDelete={async (insightId) => {
await insightsApi.delete(insightId)
toast.success('Insight deleted successfully')
setSelectedInsight(null)
await fetchInsights()
try {
await insightsApi.delete(insightId)
toast.success('Insight deleted successfully')
setSelectedInsight(null)
await fetchInsights()
} catch (err) {
console.error('Failed to delete insight:', err)
toast.error('Failed to delete insight')
}
}}
/>