From 5239e3f3cfcb7cacc67559b66e840b0c8517bb87 Mon Sep 17 00:00:00 2001 From: Thomas Hallock Date: Sat, 10 Jan 2026 18:19:07 -0600 Subject: [PATCH] fix(vision): fix sync status API endpoint and enable for both models - Fix sync status fetch URL from non-existent /api/vision-training/sync/status to the correct /api/vision-training/sync endpoint - Add modelType query parameter to both GET (status) and POST (sync) requests - Enable sync feature for both boundary-detector and column-classifier (was previously restricted to column-classifier only) Co-Authored-By: Claude Opus 4.5 --- .../train/components/data-panel/UnifiedDataPanel.tsx | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/apps/web/src/app/vision-training/train/components/data-panel/UnifiedDataPanel.tsx b/apps/web/src/app/vision-training/train/components/data-panel/UnifiedDataPanel.tsx index ecb271ea..6c02a3bf 100644 --- a/apps/web/src/app/vision-training/train/components/data-panel/UnifiedDataPanel.tsx +++ b/apps/web/src/app/vision-training/train/components/data-panel/UnifiedDataPanel.tsx @@ -199,13 +199,11 @@ export function UnifiedDataPanel({ modelType, onDataChanged }: UnifiedDataPanelP loadItems() }, [loadItems]) - // Fetch sync status for column classifier + // Fetch sync status (works for both model types) useEffect(() => { - if (modelType !== 'column-classifier') return - const fetchSyncStatus = async () => { try { - const response = await fetch('/api/vision-training/sync/status') + const response = await fetch(`/api/vision-training/sync?modelType=${modelType}`) if (response.ok) { const data = await response.json() setSyncStatus(data) @@ -338,7 +336,7 @@ export function UnifiedDataPanel({ modelType, onDataChanged }: UnifiedDataPanelP const handleStartSync = useCallback(async () => { setSyncProgress({ phase: 'connecting', message: 'Connecting...' }) try { - const response = await fetch('/api/vision-training/sync', { method: 'POST' }) + const response = await fetch(`/api/vision-training/sync?modelType=${modelType}`, { method: 'POST' }) if (response.ok) { setSyncProgress({ phase: 'complete', message: 'Sync complete!' }) loadItems() @@ -353,7 +351,7 @@ export function UnifiedDataPanel({ modelType, onDataChanged }: UnifiedDataPanelP }) } setSyncHistoryRefreshTrigger((prev) => prev + 1) - }, [loadItems, onDataChanged]) + }, [modelType, loadItems, onDataChanged]) const handleCancelSync = useCallback(() => { setSyncProgress({ phase: 'idle', message: '' })