feat; cockpit
This commit is contained in:
@@ -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],
|
||||
|
||||
Reference in New Issue
Block a user