feat: saxo price

This commit is contained in:
OpenSquared
2026-07-23 17:59:27 +02:00
parent 619f521b32
commit d3dc85fee9
4 changed files with 84 additions and 3 deletions

View File

@@ -182,6 +182,20 @@ export const useSetWatchlistSaxoQuoteLink = () => {
})
}
// Free-form display name — no longer tied to yfinance's long_name lookup, since an
// instrument can now be entirely Saxo-sourced.
export const useRenameWatchlistInstrument = () => {
const qc = useQueryClient()
return useMutation({
mutationFn: ({ ticker, name }: { ticker: string; name: string }) =>
api.put(`/watchlist/${encodeURIComponent(ticker)}/name`, { name }).then(r => r.data),
onSuccess: () => {
qc.invalidateQueries({ queryKey: ['instruments-watchlist'] })
qc.invalidateQueries({ queryKey: ['instruments-watchlist-quotes'] })
},
})
}
// Latest cycle report — shares the 'cycle-report-latest' queryKey with RapportIA.tsx
export const useLatestCycleReport = () =>
useQuery({