feat: cockpit
This commit is contained in:
@@ -146,7 +146,15 @@ export const useAddWatchlistInstrument = () => {
|
||||
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()))),
|
||||
// No trailing slash: the backend route is registered at "/api/instruments" exactly
|
||||
// (router.get("")) — a trailing slash still resolves via FastAPI's redirect_slashes,
|
||||
// but calling the exact path avoids depending on that 307 round-trip surviving the
|
||||
// nginx proxy_pass unchanged.
|
||||
queryFn: () => api.get('/instruments').then(r => {
|
||||
const ids = new Set<string>((r.data ?? []).map((i: any) => String(i.id).toUpperCase()))
|
||||
console.debug('[useInstrumentCatalogIds] loaded', ids.size, 'catalog ids:', Array.from(ids))
|
||||
return ids
|
||||
}),
|
||||
staleTime: 10 * 60_000,
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user