From 8fdb0f0539791e8ee7d923be132d44675e94e1fc Mon Sep 17 00:00:00 2001 From: Luis Novo Date: Fri, 19 Dec 2025 22:48:09 -0300 Subject: [PATCH] Update frontend/src/components/source/SourceDetailContent.tsx Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com> --- .../src/components/source/SourceDetailContent.tsx | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/frontend/src/components/source/SourceDetailContent.tsx b/frontend/src/components/source/SourceDetailContent.tsx index fe350ac..8757141 100644 --- a/frontend/src/components/source/SourceDetailContent.tsx +++ b/frontend/src/components/source/SourceDetailContent.tsx @@ -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') + } }} />