fix: pass bars data to TradingView chart correctly

- Include bars in loader response
- Convert timestamp to YYYY-MM-DD format for TradingView
- Fix error response to always include bars array
This commit is contained in:
2026-05-14 11:23:33 +02:00
parent b4076f89b6
commit d1a84325ae
2 changed files with 5 additions and 5 deletions
+1 -1
View File
@@ -44,6 +44,6 @@ export async function loader({ params }: { params: { ticker: string } }) {
});
} catch (error) {
console.error("Alpaca data error:", error);
return Response.json({ error: "Failed to fetch data" }, { status: 500 });
return Response.json({ ticker, price: 0, bars: [] }, { status: 500 });
}
}