feat; cockpit

This commit is contained in:
OpenSquared
2026-07-23 20:38:18 +02:00
parent 6eba6ce5f8
commit 9cf3086254
3 changed files with 55 additions and 19 deletions

View File

@@ -140,6 +140,16 @@ export const useAddWatchlistInstrument = () => {
})
}
// Instrument Analysis runs on its own separate catalog (backend config/instruments.json,
// not services.database.instruments_watchlist) — used to gate navigation links so we
// don't send the user to a 404/error page for a ticker that isn't registered there.
export const useInstrumentCatalogIds = () =>
useQuery({
queryKey: ['instrument-analysis-catalog'],
queryFn: () => api.get('/instruments/').then(r => new Set((r.data ?? []).map((i: any) => String(i.id).toUpperCase()))),
staleTime: 10 * 60_000,
})
export const useWatchlistHistory = (ticker: string, period: string) =>
useQuery({
queryKey: ['instruments-watchlist-history', ticker, period],