feat: option lab

This commit is contained in:
OpenSquared
2026-07-21 17:23:55 +02:00
parent b6e9b96dc4
commit 78eda311f8
7 changed files with 275 additions and 82 deletions

View File

@@ -151,6 +151,20 @@ export const useRemoveWatchlistInstrument = () => {
})
}
export const useSetWatchlistSaxoLink = () => {
const qc = useQueryClient()
return useMutation({
mutationFn: ({ ticker, saxoSymbol }: { ticker: string; saxoSymbol: string | null }) =>
api.put(`/watchlist/${encodeURIComponent(ticker)}/saxo-link`, { saxo_symbol: saxoSymbol }).then(r => r.data),
onSuccess: () => {
qc.invalidateQueries({ queryKey: ['instruments-watchlist'] })
qc.invalidateQueries({ queryKey: ['instruments-watchlist-quotes'] })
qc.invalidateQueries({ queryKey: ['saxo-iv-watchlist'] })
qc.invalidateQueries({ queryKey: ['saxo-watchlist'] })
},
})
}
// Latest cycle report — shares the 'cycle-report-latest' queryKey with RapportIA.tsx
export const useLatestCycleReport = () =>
useQuery({