fix: P0 stabilisation — score modifiers, logout cache clear, provider isolation, mutation error feedback
- scoreCalculator: apply dataQuality/confidence modifiers to finalScore (were computed but hardcoded to 0) - authService: call queryClient.clear() on logout to prevent cross-session data leakage - queryClient: extract to src/lib/queryClient.ts singleton so services can access it without circular imports - matchSyncService: new service layer owns match-generation logic; MockupNeedProvider no longer imports other providers directly - hooks (11 files): add onError + German toast feedback to every useMutation Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -2,6 +2,7 @@ import { useQuery, useMutation, useQueryClient } from '@tanstack/react-query'
|
||||
import { marketIntelligenceService } from '../services/marketIntelligenceService'
|
||||
import { reviewService } from '../services/reviewService'
|
||||
import type { MarketSignalFilters, SignalProcessingStatus } from '../domain/marketSignal'
|
||||
import { useToastStore } from '../stores/toastStore'
|
||||
|
||||
const STALE_SIGNALS = 30_000
|
||||
|
||||
@@ -33,6 +34,9 @@ export function useUpdateSignalStatus() {
|
||||
queryClient.invalidateQueries({ queryKey: ['market-signals'] })
|
||||
queryClient.invalidateQueries({ queryKey: ['market-signal'] })
|
||||
},
|
||||
onError: () => {
|
||||
useToastStore.getState().showToast('Signal-Status konnte nicht aktualisiert werden.', 'error')
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
@@ -44,6 +48,9 @@ export function useConvertToFutureSignal() {
|
||||
queryClient.invalidateQueries({ queryKey: ['market-signals'] })
|
||||
queryClient.invalidateQueries({ queryKey: ['market-signal'] })
|
||||
},
|
||||
onError: () => {
|
||||
useToastStore.getState().showToast('Konvertierung zu Future Signal fehlgeschlagen.', 'error')
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
@@ -63,11 +70,17 @@ export function useLinkSignalToEntity() {
|
||||
queryClient.invalidateQueries({ queryKey: ['market-signals'] })
|
||||
queryClient.invalidateQueries({ queryKey: ['market-signal'] })
|
||||
},
|
||||
onError: () => {
|
||||
useToastStore.getState().showToast('Signal konnte nicht verknüpft werden.', 'error')
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
export function useCreateReviewTask() {
|
||||
return useMutation({
|
||||
mutationFn: (signalId: string) => reviewService.createReviewTask(signalId),
|
||||
onError: () => {
|
||||
useToastStore.getState().showToast('Überprüfungsaufgabe konnte nicht erstellt werden.', 'error')
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user