mirror of
https://github.com/caty21/forex-dashboard.git
synced 2026-08-07 17:57:44 +00:00
Fix gold/silver null: increase FRED fredObsDelta limit 2→10 to skip '.' placeholders
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -21,7 +21,7 @@ type FredResult = { value: number | null; delta: number | null; deltaPct: number
|
||||
async function fredObsDelta(series: string, apiKey: string): Promise<FredResult> {
|
||||
const empty: FredResult = { value: null, delta: null, deltaPct: null };
|
||||
try {
|
||||
const url = `https://api.stlouisfed.org/fred/series/observations?series_id=${series}&api_key=${apiKey}&file_type=json&sort_order=desc&limit=2`;
|
||||
const url = `https://api.stlouisfed.org/fred/series/observations?series_id=${series}&api_key=${apiKey}&file_type=json&sort_order=desc&limit=10`;
|
||||
const res = await fetch(url, { next: { revalidate: 86400 } });
|
||||
if (!res.ok) return empty;
|
||||
const obs: number[] = ((await res.json())?.observations ?? [])
|
||||
|
||||
Reference in New Issue
Block a user