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:
@@ -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 });
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user