diff options
| author | Tyler Hoang <tyler@tylerhoang.xyz> | 2026-05-18 00:46:27 -0700 |
|---|---|---|
| committer | Tyler Hoang <tyler@tylerhoang.xyz> | 2026-05-18 00:46:27 -0700 |
| commit | 45f3eff514a7b4c2f03e801b204920f13671dd5d (patch) | |
| tree | a71e4cd06a4af8357003c9942760e019f52414dc /frontend/lib/api.ts | |
| parent | 147664128fa0281333ba3150e007ed8e2f6a616a (diff) | |
| parent | 1e349b8904c6fa52c6f0925453513354c1a4e392 (diff) | |
Merge worktree-financials-tab: add financials tab (income/balance/cashflow)
Diffstat (limited to 'frontend/lib/api.ts')
| -rw-r--r-- | frontend/lib/api.ts | 7 |
1 files changed, 6 insertions, 1 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)}` + ); } }; |
