feat: saxo price
This commit is contained in:
@@ -107,6 +107,23 @@ def remove_ticker(ticker: str):
|
||||
return {"removed": ticker.strip().upper()}
|
||||
|
||||
|
||||
class RenameBody(BaseModel):
|
||||
name: str
|
||||
|
||||
|
||||
@router.put("/{ticker}/name")
|
||||
def rename_ticker(ticker: str, body: RenameBody):
|
||||
"""Free-form display name — no longer tied to yfinance's long_name lookup, since an
|
||||
instrument can now be entirely Saxo-sourced."""
|
||||
from services.database import rename_instrument_watchlist
|
||||
if not body.name.strip():
|
||||
raise HTTPException(400, "Name cannot be empty")
|
||||
ok = rename_instrument_watchlist(ticker, body.name)
|
||||
if not ok:
|
||||
raise HTTPException(404, f"'{ticker}' is not in the instruments watchlist")
|
||||
return {"ticker": ticker.strip().upper(), "name": body.name.strip()}
|
||||
|
||||
|
||||
class ReorderBody(BaseModel):
|
||||
tickers: List[str]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user