06/05 Optimize app
This commit is contained in:
@@ -8,6 +8,7 @@ from app.models.investment import Investment, InvestmentTransaction
|
||||
from app.services.investment_service import (
|
||||
get_portfolio_summary, update_prices, fetch_price,
|
||||
fetch_price_history, fetch_day_change,
|
||||
get_price_alerts,
|
||||
ASSET_COLORS, ASSET_TYPE_LABELS
|
||||
)
|
||||
from datetime import date
|
||||
@@ -341,6 +342,13 @@ def api_day_change(ticker):
|
||||
return jsonify(data)
|
||||
|
||||
|
||||
@investments_bp.route('/api/price-alerts')
|
||||
@login_required
|
||||
def api_price_alerts():
|
||||
"""Return today's price-alert list (holdings that moved >= 5% intraday)."""
|
||||
return jsonify({'alerts': get_price_alerts()})
|
||||
|
||||
|
||||
@investments_bp.route('/api/history/<ticker>')
|
||||
@login_required
|
||||
def api_price_history(ticker):
|
||||
|
||||
Reference in New Issue
Block a user