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:
parent
c7de8ecd86
commit
8fdb0f0539
1 changed files with 9 additions and 4 deletions
|
|
@ -782,10 +782,15 @@ export function SourceDetailContent({
|
||||||
}}
|
}}
|
||||||
insight={selectedInsight ?? undefined}
|
insight={selectedInsight ?? undefined}
|
||||||
onDelete={async (insightId) => {
|
onDelete={async (insightId) => {
|
||||||
await insightsApi.delete(insightId)
|
try {
|
||||||
toast.success('Insight deleted successfully')
|
await insightsApi.delete(insightId)
|
||||||
setSelectedInsight(null)
|
toast.success('Insight deleted successfully')
|
||||||
await fetchInsights()
|
setSelectedInsight(null)
|
||||||
|
await fetchInsights()
|
||||||
|
} catch (err) {
|
||||||
|
console.error('Failed to delete insight:', err)
|
||||||
|
toast.error('Failed to delete insight')
|
||||||
|
}
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue