diff options
| -rw-r--r-- | frontend/lib/api.ts | 7 | ||||
| -rw-r--r-- | frontend/lib/overview.ts | 2 |
2 files changed, 7 insertions, 2 deletions
diff --git a/frontend/lib/api.ts b/frontend/lib/api.ts index b2f0dea..05af5ae 100644 --- a/frontend/lib/api.ts +++ b/frontend/lib/api.ts @@ -1,4 +1,4 @@ -import type { HistoryPoint, MarketIndex, SearchResult, TickerOverview, WatchlistResponse } from "@/types/api"; +import type { FinancialsResponse, HistoryPoint, MarketIndex, SearchResult, TickerOverview, WatchlistResponse } from "@/types/api"; const API_BASE = process.env.NEXT_PUBLIC_API_BASE_URL || "http://localhost:8000"; @@ -48,5 +48,10 @@ export const api = { }, removeWatchlist(symbol: string) { return request<WatchlistResponse>(`/api/watchlist/${encodeURIComponent(symbol)}`, { method: "DELETE" }); + }, + financials(symbol: string, period: "annual" | "quarterly" = "annual") { + return request<FinancialsResponse>( + `/api/tickers/${encodeURIComponent(symbol)}/financials?period=${encodeURIComponent(period)}` + ); } }; diff --git a/frontend/lib/overview.ts b/frontend/lib/overview.ts index d02c5d3..1ec793a 100644 --- a/frontend/lib/overview.ts +++ b/frontend/lib/overview.ts @@ -17,7 +17,7 @@ export type NavItem = { export const OVERVIEW_NAV_ITEMS: NavItem[] = [ { key: "overview", label: "Overview", icon: "chart" }, - { key: "financials", label: "Financials", icon: "ledger", disabled: true }, + { key: "financials", label: "Financials", icon: "ledger" }, { key: "valuation", label: "Valuation", icon: "dollar", disabled: true }, { key: "options", label: "Options", icon: "window", disabled: true }, { key: "insiders", label: "Insiders", icon: "pulse", disabled: true }, |
