diff --git a/frontend/src/components/upload/OwnerList.tsx b/frontend/src/components/upload/OwnerList.tsx index 52a9d32..2b54c21 100644 --- a/frontend/src/components/upload/OwnerList.tsx +++ b/frontend/src/components/upload/OwnerList.tsx @@ -22,7 +22,11 @@ const statusLabels: Record = { pooled: '已入库', } -export default function OwnerList() { +interface OwnerListProps { + onStatsChange?: () => void +} + +export default function OwnerList({ onStatsChange }: OwnerListProps) { const [owners, setOwners] = useState([]) const [total, setTotal] = useState(0) const [loading, setLoading] = useState(false) @@ -63,6 +67,7 @@ export default function OwnerList() { try { await fetch(`/api/db/owners/${id}`, { method: 'DELETE' }) loadOwners() + onStatsChange?.() } catch (e) { console.error('Failed to delete:', e) } @@ -73,6 +78,7 @@ export default function OwnerList() { try { await fetch('/api/db/owners/clear', { method: 'POST' }) loadOwners() + onStatsChange?.() } catch (e) { console.error('Failed to clear:', e) } diff --git a/frontend/src/pages/Upload.tsx b/frontend/src/pages/Upload.tsx index 423c8f2..ad79910 100644 --- a/frontend/src/pages/Upload.tsx +++ b/frontend/src/pages/Upload.tsx @@ -464,7 +464,7 @@ export default function Upload() { {activeTab === 'owners' && (
- +
)}