"""Dashboard REST endpoint — the aggregated landing payload."""
from quart import Blueprint, g, jsonify

from scribe.auth import login_required
from scribe.services.dashboard import build_dashboard

dashboard_bp = Blueprint("dashboard", __name__, url_prefix="/api/dashboard")


@dashboard_bp.get("")
@login_required
async def get_dashboard():
    return jsonify(await build_dashboard(g.user.id))
