Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions app/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,12 @@ def home():

@app.route('/menu')
def menu():
today = Menu.query.first()
if today:
body = { "today_special": today.name }
all_items = Menu.query.all()
if all_items:
menu_list = [{"id": item.id, "name": item.name, "price": item.price} for item in all_items]
body = { "menu": menu_list }
status = 200
else:
body = { "error": "Sorry, the service is not available today." }
body = { "error": "Sorry, no menu items are available today." }
status = 404
return jsonify(body), status
return jsonify(body), status
1 change: 1 addition & 0 deletions new-repo1
Submodule new-repo1 added at 35115e