feat: option lab
This commit is contained in:
@@ -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({
|
||||
|
||||
Reference in New Issue
Block a user