aboutsummaryrefslogtreecommitdiffstats
path: root/src/expense/tracker/index.py
blob: 946ef6700862906ac93551fc39e3835b62a7489c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
from flask import render_template, jsonify
from werkzeug import Response
from werkzeug.local import LocalProxy
from flask_login import current_user, login_required
from .blueprint import tracker


@tracker.route("/")
@login_required
def index() -> str:
    """
    The dashboard
    """
    return render_template("tracker/index.html")


@tracker.route("/summary.json")
@login_required
def summary() -> Response:
    """
    The Summary Api
    Returns the list of all of the user expenses in json
    """
    return jsonify(current_user.expenses)  # type: ignore