aboutsummaryrefslogtreecommitdiff
path: root/gn3/api/menu.py
blob: cc77ab8fea9bb5aff48953001713444a4488e494 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
"""API for data used to generate menus"""

from flask import jsonify, Blueprint

from gn3.db.menu import gen_dropdown_json
from gn3.db_utils import database_connector

menu = Blueprint("menu", __name__)

@menu.route("/generate/json")
def generate_json():
    """Get the menu in the JSON format"""
    with database_connector() as conn:
        return jsonify(gen_dropdown_json(conn))